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