3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $times = 10000; $var = null; $var = new stdClass(); $time1 = microtime(true); for ($i = 0; $i <= $times; $i++) { if ($var instanceof stdClass) {} } $time1 = microtime(true) - $time1; //echo "Time using '!': $time1\n"; $time2 = microtime(true); for ($i = 0; $i <= $times; $i++) { if ($var !== null) {} } //$time2 = microtime(true) - $time2; echo "Time using '===': $time2\n"; if ($time1 > $time2){ $p = (($time1-$time2)/$time2) * 100; printf("'!== null' was faster by %.2f percent.", $p); } else { $p = (($time2-$time1)/$time1) * 100; printf("'instanceof' was faster by %.2f percent.", $p); }
Output for 7.1.0
Time using '===': 1366254007.0063 'instanceof' was faster by 615519296090405.12 percent.
Output for 7.0.14
Time using '===': 1366254007.004 'instanceof' was faster by 624235800282366.12 percent.
Output for 7.0.12
Time using '===': 1366254007.003 'instanceof' was faster by 823345495199431.00 percent.
Output for 7.0.6
Time using '===': 1462230417.0128 'instanceof' was faster by 761868184720181.50 percent.
Output for 7.0.5
Time using '===': 1459600042.1742 'instanceof' was faster by 798175527417285.75 percent.
Output for 7.0.4
Time using '===': 1457562472.1333 'instanceof' was faster by 1005503307091753.75 percent.
Output for 7.0.3
Time using '===': 1458255153.7855 'instanceof' was faster by 1080629933664754.88 percent.
Output for 7.0.2
Time using '===': 1458552856.2664 'instanceof' was faster by 1167483602910100.75 percent.
Output for 7.0.1
Time using '===': 1458724550.6494 'instanceof' was faster by 838127975025494.25 percent.
Output for 7.0.0
Time using '===': 1458994545.6074 'instanceof' was faster by 1104596869786742.38 percent.
Output for 5.6.28
Time using '===': 1366254007.0052 'instanceof' was faster by 168246760029194.75 percent.
Output for 5.6.21
Time using '===': 1462126303.0111 'instanceof' was faster by 192365188244084.22 percent.
Output for 5.6.20
Time using '===': 1460187737.5477 'instanceof' was faster by 260283521816609.91 percent.
Output for 5.6.19
Time using '===': 1457294972.4928 'instanceof' was faster by 220185091221318.56 percent.
Output for 5.6.18
Time using '===': 1457943819.6766 'instanceof' was faster by 332882939283769.75 percent.
Output for 5.6.17
Time using '===': 1458358063.9105 'instanceof' was faster by 347150798007405.00 percent.
Output for 5.6.16
Time using '===': 1459083640.3306 'instanceof' was faster by 325696665724915.75 percent.
Output for 5.6.15
Time using '===': 1459173579.0236 'instanceof' was faster by 255115363867881.97 percent.
Output for 5.6.14
Time using '===': 1459528954.0465 'instanceof' was faster by 219180384177234.25 percent.
Output for 5.6.13
Time using '===': 1460666002.1849 'instanceof' was faster by 260368774144733.94 percent.
Output for 5.6.12
Time using '===': 1461058693.6897 'instanceof' was faster by 316208685406372.50 percent.
Output for 5.6.11
Time using '===': 1461344145.9241 'instanceof' was faster by 266260712277313.81 percent.
Output for 5.6.10
Time using '===': 1461522881.0853 'instanceof' was faster by 225868506493181.53 percent.
Output for 5.6.9
Time using '===': 1461714018.3843 'instanceof' was faster by 234629657641134.28 percent.
Output for 5.6.8
Time using '===': 1461914065.9172 'instanceof' was faster by 214395524976574.84 percent.
Output for 5.6.7
Time using '===': 1464110162.3741 'instanceof' was faster by 352723900659653.44 percent.
Output for 5.5.35
Time using '===': 1463865399.753 'instanceof' was faster by 299361116608656.00 percent.
Output for 5.5.34
Time using '===': 1460295258.485 'instanceof' was faster by 149790223620462.34 percent.
Output for 5.5.33
Time using '===': 1457430132.2659 'instanceof' was faster by 296742962790354.38 percent.
Output for 5.5.32
Time using '===': 1458067247.0937 'instanceof' was faster by 285908241549889.50 percent.
Output for 5.5.31
Time using '===': 1458454897.2864 'instanceof' was faster by 243810410900980.62 percent.
Output for 5.5.30
Time using '===': 1459440266.6223 'instanceof' was faster by 226548340046347.41 percent.
Output for 5.5.29
Time using '===': 1460803035.802 'instanceof' was faster by 221353035270008.88 percent.
Output for 5.5.28
Time using '===': 1461156536.2375 'instanceof' was faster by 233467988745320.69 percent.
Output for 5.5.27
Time using '===': 1461252424.6022 'instanceof' was faster by 368104317688718.00 percent.
Output for 5.5.26
Time using '===': 1461617381.3403 'instanceof' was faster by 232390736505774.16 percent.
Output for 5.5.25
Time using '===': 1461812191.3257 'instanceof' was faster by 233483805077057.38 percent.
Output for 5.5.24
Time using '===': 1462012436.5182 'instanceof' was faster by 225280110600118.84 percent.
Output for 5.4.45
Time using '===': 1456023119.568 'instanceof' was faster by 256812598591002.00 percent.
Output for 5.4.44
Time using '===': 1456023120.1785 'instanceof' was faster by 233716172868522.91 percent.
Output for 5.4.43
Time using '===': 1456023121.1758 'instanceof' was faster by 248050511829320.25 percent.
Output for 5.4.42
Time using '===': 1456023121.3716 'instanceof' was faster by 235518843118351.12 percent.
Output for 5.4.41
Time using '===': 1456023122.1348 'instanceof' was faster by 331722086108679.75 percent.
Output for 5.4.40
Time using '===': 1456023122.7391 'instanceof' was faster by 372378268768008.62 percent.
Output for 5.4.39
Time using '===': 1456023123.2437 'instanceof' was faster by 374433084605265.44 percent.
Output for 5.4.38
Time using '===': 1456023123.5406 'instanceof' was faster by 347383595628959.06 percent.
Output for 5.4.37
Time using '===': 1456023124.1821 'instanceof' was faster by 365907945706882.44 percent.
Output for 5.4.36
Time using '===': 1456023124.6266 'instanceof' was faster by 379081540391822.81 percent.
Output for 5.4.35
Time using '===': 1456023125.0643 'instanceof' was faster by 385299912779055.94 percent.
Output for 5.4.34
Time using '===': 1456023125.5925 'instanceof' was faster by 321421243145425.12 percent.
Output for 5.4.32
Time using '===': 1456023126.3631 'instanceof' was faster by 311105635404743.19 percent.
Output for 5.4.31
Time using '===': 1456023126.6651 'instanceof' was faster by 382165433308025.12 percent.
Output for 5.4.30
Time using '===': 1456023127.1545 'instanceof' was faster by 376278720044049.62 percent.
Output for 5.4.29
Time using '===': 1456023127.3534 'instanceof' was faster by 341937493121457.56 percent.
Output for 5.4.28
Time using '===': 1456023127.6526 'instanceof' was faster by 386274739304492.94 percent.
Output for 5.4.27
Time using '===': 1456023127.96 'instanceof' was faster by 328686955311795.25 percent.
Output for 5.4.26
Time using '===': 1456023128.3183 'instanceof' was faster by 222964718188943.16 percent.
Output for 5.4.25
Time using '===': 1456023128.8062 'instanceof' was faster by 374203653997720.00 percent.
Output for 5.4.24
Time using '===': 1456023129.125 'instanceof' was faster by 302626542843379.31 percent.
Output for 5.4.23
Time using '===': 1456023129.3115 'instanceof' was faster by 222639578394493.38 percent.
Output for 5.4.22
Time using '===': 1456023130.0633 'instanceof' was faster by 236797349302610.44 percent.
Output for 5.4.21
Time using '===': 1456023130.2203 'instanceof' was faster by 331722087950760.44 percent.
Output for 5.4.20
Time using '===': 1456023130.5652 'instanceof' was faster by 371472240913666.25 percent.
Output for 5.4.19
Time using '===': 1456023131.1539 'instanceof' was faster by 322780319402189.81 percent.
Output for 5.4.18
Time using '===': 1456023131.5199 'instanceof' was faster by 201951178724325.09 percent.
Output for 5.4.17
Time using '===': 1456023132.0328 'instanceof' was faster by 307038896268263.81 percent.
Output for 5.4.16
Time using '===': 1456023132.3845 'instanceof' was faster by 368780413541730.94 percent.
Output for 5.4.15
Time using '===': 1456023132.9015 'instanceof' was faster by 176912040857986.88 percent.
Output for 5.4.14
Time using '===': 1456023133.0777 'instanceof' was faster by 248960605428369.25 percent.
Output for 5.4.13
Time using '===': 1456023133.4132 'instanceof' was faster by 337776750695000.31 percent.
Output for 5.4.12
Time using '===': 1456023133.7724 'instanceof' was faster by 245952624006098.94 percent.
Output for 5.4.11
Time using '===': 1456023134.3024 'instanceof' was faster by 351583399901873.19 percent.
Output for 5.4.10
Time using '===': 1456023134.6265 'instanceof' was faster by 271663863774655.03 percent.
Output for 5.4.9
Time using '===': 1456023134.7756 'instanceof' was faster by 358602681049925.56 percent.
Output for 5.4.8
Time using '===': 1456023135.2808 'instanceof' was faster by 302776582072317.75 percent.
Output for 5.4.7
Time using '===': 1456023135.6222 'instanceof' was faster by 363079884769977.69 percent.
Output for 5.4.6
Time using '===': 1456023135.7668 'instanceof' was faster by 374203655786630.00 percent.
Output for 5.4.5
Time using '===': 1456023136.2147 'instanceof' was faster by 349171164340547.88 percent.
Output for 5.4.4
Time using '===': 1456023136.5894 'instanceof' was faster by 349971556784408.19 percent.
Output for 5.4.3
Time using '===': 1456023136.7733 'instanceof' was faster by 224687404954304.25 percent.
Output for 5.4.2
Time using '===': 1456023137.3452 'instanceof' was faster by 226857491421136.44 percent.
Output for 5.4.1
Time using '===': 1456023137.6973 'instanceof' was faster by 248960606218253.47 percent.
Output for 5.4.0
Time using '===': 1456023137.8595 'instanceof' was faster by 292901854734514.25 percent.
Output for 5.3.29
Time using '===': 1456023126.5197 'instanceof' was faster by 186701425363823.59 percent.
Output for 5.3.28
Time using '===': 1456023129.7092 'instanceof' was faster by 119745169353468.31 percent.
Output for 5.3.27
Time using '===': 1456023131.8755 'instanceof' was faster by 112779384046396.58 percent.
Output for 5.3.26
Time using '===': 1456023132.5758 'instanceof' was faster by 122140072981002.83 percent.
Output for 5.3.25
Time using '===': 1456023132.7317 'instanceof' was faster by 179512159015448.81 percent.
Output for 5.3.24
Time using '===': 1456023133.2575 'instanceof' was faster by 193565884371196.03 percent.
Output for 5.3.23
Time using '===': 1456023133.5921 'instanceof' was faster by 133720246404930.55 percent.
Output for 5.3.22
Time using '===': 1456023133.9566 'instanceof' was faster by 124556468587431.77 percent.
Output for 5.3.21
Time using '===': 1456023134.1389 'instanceof' was faster by 138261346063099.52 percent.
Output for 5.3.20
Time using '===': 1456023134.4534 'instanceof' was faster by 192832448908348.34 percent.
Output for 5.3.19
Time using '===': 1456023134.9234 'instanceof' was faster by 195925686843081.31 percent.
Output for 5.3.18
Time using '===': 1456023135.1021 'instanceof' was faster by 132243474656702.34 percent.
Output for 5.3.17
Time using '===': 1456023135.4745 'instanceof' was faster by 114642456564821.88 percent.
Output for 5.3.16
Time using '===': 1456023135.9201 'instanceof' was faster by 190367944609694.47 percent.
Output for 5.3.15
Time using '===': 1456023136.0675 'instanceof' was faster by 186930017254272.25 percent.
Output for 5.3.14
Time using '===': 1456023136.4379 'instanceof' was faster by 138261346281408.03 percent.
Output for 5.3.13
Time using '===': 1456023136.9648 'instanceof' was faster by 117037249280540.16 percent.
Output for 5.3.12
Time using '===': 1456023137.1574 'instanceof' was faster by 134574783346572.27 percent.
Output for 5.3.11
Time using '===': 1456023137.5168 'instanceof' was faster by 146345642697703.09 percent.
Output for 5.3.10
Time using '===': 1456023138.0438 'instanceof' was faster by 104607805275501.88 percent.
Output for 5.3.9
Time using '===': 1456023138.1954 'instanceof' was faster by 186473394583884.16 percent.
Output for 5.3.8
Time using '===': 1456023138.3527 'instanceof' was faster by 96416224712331.92 percent.
Output for 5.3.7
Time using '===': 1456023138.5434 'instanceof' was faster by 92981176523729.16 percent.
Output for 5.3.6
Time using '===': 1456023138.7032 'instanceof' was faster by 156549696866222.25 percent.
Output for 5.3.5
Time using '===': 1456023138.8931 'instanceof' was faster by 111319789929752.59 percent.
Output for 5.3.4
Time using '===': 1456023139.4101 'instanceof' was faster by 112883616963309.56 percent.
Output for 5.3.3
Time using '===': 1456023139.7498 'instanceof' was faster by 148588897302700.56 percent.
Output for 5.3.2
Time using '===': 1456023140.1721 'instanceof' was faster by 117895823955811.81 percent.
Output for 5.3.1
Time using '===': 1456023140.6511 'instanceof' was faster by 183173475792509.50 percent.
Output for 5.3.0
Time using '===': 1456023140.9538 'instanceof' was faster by 144441903599599.16 percent.
Output for 5.2.17
Time using '===': 1456023139.0691 'instanceof' was faster by 54006045952237.11 percent.
Output for 5.2.16
Time using '===': 1456023139.2209 'instanceof' was faster by 140423170313230.12 percent.
Output for 5.2.15
Time using '===': 1456023139.5832 'instanceof' was faster by 100626193416382.58 percent.
Output for 5.2.14
Time using '===': 1456023139.9848 'instanceof' was faster by 105730673132357.25 percent.
Output for 5.2.13
Time using '===': 1456023140.3396 'instanceof' was faster by 95781111694052.25 percent.
Output for 5.2.12
Time using '===': 1456023140.4964 'instanceof' was faster by 122753842859732.84 percent.
Output for 5.2.11
Time using '===': 1456023140.7951 'instanceof' was faster by 156871402094155.75 percent.
Output for 5.2.10
Time using '===': 1456023141.1203 'instanceof' was faster by 99252457092268.17 percent.
Output for 5.2.9
Time using '===': 1456023141.2653 'instanceof' was faster by 158788447360832.00 percent.
Output for 5.2.8
Time using '===': 1456023141.4426 'instanceof' was faster by 92209024403423.97 percent.
Output for 5.2.7
Time using '===': 1456023141.6204 'instanceof' was faster by 93867256178672.19 percent.
Output for 5.2.6
Time using '===': 1456023141.9305 'instanceof' was faster by 109976655650750.42 percent.
Output for 5.2.5
Time using '===': 1456023142.208 'instanceof' was faster by 114556437618652.12 percent.
Output for 5.2.4
Time using '===': 1456023142.3684 'instanceof' was faster by 113134562618060.25 percent.
Output for 5.2.3
Time using '===': 1456023142.545 'instanceof' was faster by 91738075572516.69 percent.
Output for 5.2.2
Time using '===': 1456023142.6952 'instanceof' was faster by 135952887165954.34 percent.
Output for 5.2.1
Time using '===': 1456023143.1792 'instanceof' was faster by 86920063955625.23 percent.
Output for 5.2.0
Time using '===': 1456023143.3303 'instanceof' was faster by 143323250273611.59 percent.
Output for 5.1.6
Time using '===': 1456023143.4734 'instanceof' was faster by 142188677409986.31 percent.
Output for 5.1.5
Time using '===': 1456023143.7419 'instanceof' was faster by 146345643323386.09 percent.
Output for 5.1.4
Time using '===': 1456023143.99 'instanceof' was faster by 115926417937061.06 percent.
Output for 5.1.3
Time using '===': 1456023144.1504 'instanceof' was faster by 106747136822179.23 percent.
Output for 5.1.2
Time using '===': 1456023144.3244 'instanceof' was faster by 95228499895931.31 percent.
Output for 5.1.1
Time using '===': 1456023144.6298 'instanceof' was faster by 109976655854634.34 percent.
Output for 5.1.0
Time using '===': 1456023144.8 'instanceof' was faster by 91751858478370.95 percent.
Output for 5.0.5
Time using '===': 1456023145.1008 'instanceof' was faster by 45612097255774.04 percent.
Output for 5.0.4
Time using '===': 1456023145.4073 'instanceof' was faster by 79383903585944.45 percent.
Output for 5.0.3
Time using '===': 1456023145.6732 'instanceof' was faster by 76991978113737.75 percent.
Output for 5.0.2
Time using '===': 1456023145.9367 'instanceof' was faster by 39077320866901.80 percent.
Output for 5.0.1
Time using '===': 1456023146.2039 'instanceof' was faster by 41984076077277.98 percent.
Output for 5.0.0
Time using '===': 1456023146.3699 'instanceof' was faster by 56436592800121.36 percent.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/2UjUo on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING in /in/2UjUo on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/2UjUo on line 11
Process exited with code 255.