xref: /PHP-8.1/Zend/tests/bug78154.phpt (revision 9975986b)
1--TEST--
2Bug #78154: SEND_VAR_NO_REF does not always send reference
3--FILE--
4<?php
5
6namespace {
7    try {
8        var_dump(similar_text('a', 'a', $c=0x44444444));
9        var_dump($c);
10    } catch (Throwable $e) {
11        echo "Exception: " . $e->getMessage() . "\n";
12    }
13}
14namespace Foo {
15    try {
16        var_dump(similar_text('a', 'a', $d=0x44444444));
17        var_dump($d);
18    } catch (\Throwable $e) {
19        echo "Exception: " . $e->getMessage() . "\n";
20    }
21}
22
23?>
24--EXPECT--
25Exception: similar_text(): Argument #3 ($percent) cannot be passed by reference
26Exception: similar_text(): Argument #3 ($percent) cannot be passed by reference
27