1--TEST-- 2JIT IDENTICAL: 002 Comparison with NaN 3--INI-- 4opcache.enable=1 5opcache.enable_cli=1 6opcache.file_update_protection=0 7opcache.jit_buffer_size=1M 8opcache.protect_memory=1 9--EXTENSIONS-- 10opcache 11--FILE-- 12<?php 13function t() { 14 echo "!"; 15 return true; 16} 17function f() { 18 echo "!"; 19 return false; 20} 21$a = 0.0; 22$b = 0.0; 23$c = 1.0; 24$d = NAN; 25var_dump($a === $b); 26var_dump($a === $c); 27var_dump($a === $d); 28var_dump($a !== $b); 29var_dump($a !== $c); 30var_dump($a !== $d); 31var_dump($a === $b ? 1 : 0); 32var_dump($a === $c ? 1 : 0); 33var_dump($a === $d ? 1 : 0); 34var_dump($a !== $b ? 1 : 0); 35var_dump($a !== $c ? 1 : 0); 36var_dump($a !== $d ? 1 : 0); 37if ($a === $b) { 38 echo "1\n"; 39} 40if ($a === $c) { 41 echo "2\n"; 42} 43if ($a === $d) { 44 echo "3\n"; 45} 46if ($a !== $b) { 47 echo "4\n"; 48} 49if ($a !== $c) { 50 echo "5\n"; 51} 52if ($a !== $d) { 53 echo "6\n"; 54} 55if ($a === $b) { 56} else { 57 echo "7\n"; 58} 59if ($a === $c) { 60} else { 61 echo "8\n"; 62} 63if ($a === $d) { 64} else { 65 echo "9\n"; 66} 67if ($a !== $b) { 68} else { 69 echo "A\n"; 70} 71if ($a !== $c) { 72} else { 73 echo "B\n"; 74} 75if ($a !== $d) { 76} else { 77 echo "C\n"; 78} 79var_dump($a === $b && t()); 80var_dump($a === $c && t()); 81var_dump($a === $d && t()); 82var_dump($a !== $b && t()); 83var_dump($a !== $c && t()); 84var_dump($a !== $d && t()); 85var_dump($a === $b || f()); 86var_dump($a === $c || f()); 87var_dump($a === $d || f()); 88var_dump($a !== $b || f()); 89var_dump($a !== $c || f()); 90var_dump($a !== $d || f()); 91$a=NAN; 92var_dump($a === $d); 93var_dump($a !== $d); 94var_dump($a === $d ? 1 : 0); 95var_dump($a !== $d ? 1 : 0); 96?> 97--EXPECT-- 98bool(true) 99bool(false) 100bool(false) 101bool(false) 102bool(true) 103bool(true) 104int(1) 105int(0) 106int(0) 107int(0) 108int(1) 109int(1) 1101 1115 1126 1138 1149 115A 116!bool(true) 117bool(false) 118bool(false) 119bool(false) 120!bool(true) 121!bool(true) 122bool(true) 123!bool(false) 124!bool(false) 125!bool(false) 126bool(true) 127bool(true) 128bool(false) 129bool(true) 130int(0) 131int(1) 132