summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-09-27 10:39:21 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-09-27 10:40:41 +0200
commita6c9c7c2b8cfd4db8fcdcb66b908feac31b600af (patch)
treeaa58af21678aa7da13c6c100fbe77f2055df2bb9 /scripts
parentd71f859a56757df16e20d72b22366a02ff9fec54 (diff)
downloadphp-git-a6c9c7c2b8cfd4db8fcdcb66b908feac31b600af.tar.gz
Handle resources used as array keys consistently
Resources used as array keys are generally handled by throwing a notice and converting the resource to the resource handle. The only exception is the [$resource => null] syntax, where this was treated as an illegal offset type instead. However, this also only happened for VM evaluations, the AST evaluator did handle resources correctly.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dev/bless_tests.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/dev/bless_tests.php b/scripts/dev/bless_tests.php
index 25a4843c07..fbbfe505c9 100755
--- a/scripts/dev/bless_tests.php
+++ b/scripts/dev/bless_tests.php
@@ -54,6 +54,10 @@ function normalizeOutput(string $out): string {
$out = preg_replace('/^#(\d+) \/.+\(\d+\):/m', '#$1 %s(%d):', $out);
$out = preg_replace('/Resource id #\d+/', 'Resource id #%d', $out);
$out = preg_replace('/resource\(\d+\) of type/', 'resource(%d) of type', $out);
+ $out = preg_replace(
+ '/Resource ID#\d+ used as offset, casting to integer \(\d+\)/',
+ 'Resource ID#%d used as offset, casting to integer (%d)',
+ $out);
$out = preg_replace('/string\(\d+\) "([^"]*%d)/', 'string(%d) "$1', $out);
return $out;
}