3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Did you know strings are numbers?\n"; $number = "2sdfsdfjoi"; var_dump($number == 2); // = true (wat?) $number = "22sdfsdfjoi"; var_dump($number == 2); // = false (makes sense...) var_dump($number == 22); // = true (wait, wat?) echo "Strings are also both true and false\n"; var_dump($number == true); // string = true (ugghh) var_dump($number == false); // string also = false (kill me now) echo "The triple equals === is the only way to be sure\n"; var_dump($number === 22); // === the only way to be sure.
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2T7Sd
function name:  (null)
number of ops:  30
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'Did+you+know+strings+are+numbers%3F%0A'
    4     1        ASSIGN                                                   !0, '2sdfsdfjoi'
    5     2        INIT_FCALL                                               'var_dump'
          3        IS_EQUAL                                         ~2      !0, 2
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
    7     6        ASSIGN                                                   !0, '22sdfsdfjoi'
    8     7        INIT_FCALL                                               'var_dump'
          8        IS_EQUAL                                         ~5      !0, 2
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
    9    11        INIT_FCALL                                               'var_dump'
         12        IS_EQUAL                                         ~7      !0, 22
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                                 
   11    15        ECHO                                                     'Strings+are+also+both+true+and+false%0A'
   12    16        INIT_FCALL                                               'var_dump'
         17        BOOL                                             ~9      !0
         18        SEND_VAL                                                 ~9
         19        DO_ICALL                                                 
   13    20        INIT_FCALL                                               'var_dump'
         21        BOOL_NOT                                         ~11     !0
         22        SEND_VAL                                                 ~11
         23        DO_ICALL                                                 
   15    24        ECHO                                                     'The+triple+equals+%3D%3D%3D+is+the+only+way+to+be+sure%0A'
   16    25        INIT_FCALL                                               'var_dump'
         26        IS_IDENTICAL                                     ~13     !0, 22
         27        SEND_VAL                                                 ~13
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.2 ms | 1395 KiB | 15 Q