3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Strings are sometimes numbers?\n"; $number = "2sdfsdfjoi"; var_dump($number == 2); // = true (wat?) $number = "22sdfsdfjoi"; var_dump($number == 2); // = false (makes sense...) var_dump($number == 22); // = true (wat?) echo "Strings are always == true\n"; var_dump($number == true); // string = true (ugghh) 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/k3Mgb
function name:  (null)
number of ops:  26
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'Strings+are+sometimes+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+always+%3D%3D+true%0A'
   12    16        INIT_FCALL                                               'var_dump'
         17        BOOL                                             ~9      !0
         18        SEND_VAL                                                 ~9
         19        DO_ICALL                                                 
   14    20        ECHO                                                     'The+triple+equals+%3D%3D%3D+is+the+only+way+to+be+sure%0A'
   15    21        INIT_FCALL                                               'var_dump'
         22        IS_IDENTICAL                                     ~11     !0, 22
         23        SEND_VAL                                                 ~11
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.29 ms | 1395 KiB | 15 Q