xref: /php-src/ext/opcache/tests/jit/bug80839.phpt (revision c16ad918)
1--TEST--
2Bug #80839: PHP problem with JIT
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.jit=function
7--EXTENSIONS--
8opcache
9--FILE--
10<?php
11$a = null; // the problem only occurs when set to NULL
12test($a, 'y');
13
14function test($str, $pad) {
15	$x = $str . str_repeat($pad, 15); // $x now contains "yyyyyyyyyyyyyyy"
16	var_dump($x);
17
18	$gft = new gft();
19	$gft->info(33);
20
21	// $x has been changed ????
22	// $x contains what was echoed in the function 'info'
23	var_dump($x);
24}
25class gft {
26	private $strVal = 'abcd ';
27	public function info($info, $prefix = ' Info:') {
28		echo $this->strVal.$prefix.serialize($info).'aaaa';
29		echo "\n";
30	}
31}
32?>
33--EXPECT--
34string(15) "yyyyyyyyyyyyyyy"
35abcd  Info:i:33;aaaa
36string(15) "yyyyyyyyyyyyyyy"
37