xref: /PHP-7.2/ext/opcache/tests/bool_not_cv.phpt (revision a2c41c0e)
1--TEST--
2$v = !$v/(bool)$v checks for undefined variables
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_cache_only=0
7--SKIPIF--
8<?php require_once('skipif.inc'); ?>
9--FILE--
10<?php
11function undef_negation() {
12    echo "In undef_negation\n";
13    $v = !$v;
14    var_export($v);
15    echo "\n";
16}
17function undef_bool_cast() {
18    echo "In undef_bool_cast\n";
19    $v = (bool)$v;
20    var_export($v);
21    echo "\n";
22}
23undef_negation();
24undef_bool_cast();
25?>
26--EXPECTF--
27In undef_negation
28
29Notice: Undefined variable: v in %s on line 4
30true
31In undef_bool_cast
32
33Notice: Undefined variable: v in %s on line 10
34false
35