File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug38779.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Bug #38779 (engine crashes when require()'ing file with syntax error through userspace stream wrapper)
    3: --FILE--
    4: <?php
    5: 
    6: class Loader {
    7: 	private $position;
    8: 	private $data;
    9: 	public function stream_open($path, $mode, $options, &$opened_path)  {
   10: 		$this->data = '<' . "?php \n\"\";ll l\n ?" . '>';
   11: 		$this->position = 0;
   12: 		return true;
   13: 	}
   14: 	function stream_read($count) {
   15: 		$ret = substr($this->data, $this->position, $count);
   16: 		$this->position += strlen($ret);
   17: 		return $ret;
   18: 	}
   19: 	function stream_eof() {
   20: 		return $this->position >= strlen($this->data);
   21: 	}
   22: 	function stream_stat() {
   23: 		return array('size' => strlen($this->data));
   24: 	}
   25: }
   26: stream_wrapper_register('Loader', 'Loader');
   27: require 'Loader://qqq.php';
   28: 
   29: echo "Done\n";
   30: ?>
   31: --EXPECTF--	
   32: Parse error: %s error%sin Loader://qqq.php on line %d

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>