3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test ($x){ if ($x === null || $x === ''){ return false; } return true; } var_dump(@test($x)); $x = null; var_dump(@test($x)); $x = '0'; var_dump(@test('0' ));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fFf08
function name:  (null)
number of ops:  27
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        BEGIN_SILENCE                                    ~1      
          2        INIT_FCALL                                               'test'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        END_SILENCE                                              ~1
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
   11     8        ASSIGN                                                   !0, null
   12     9        INIT_FCALL                                               'var_dump'
         10        BEGIN_SILENCE                                    ~5      
         11        INIT_FCALL                                               'test'
         12        SEND_VAR                                                 !0
         13        DO_FCALL                                      0  $6      
         14        END_SILENCE                                              ~5
         15        SEND_VAR                                                 $6
         16        DO_ICALL                                                 
   14    17        ASSIGN                                                   !0, '0'
   15    18        INIT_FCALL                                               'var_dump'
         19        BEGIN_SILENCE                                    ~9      
         20        INIT_FCALL                                               'test'
         21        SEND_VAL                                                 '0'
         22        DO_FCALL                                      0  $10     
         23        END_SILENCE                                              ~9
         24        SEND_VAR                                                 $10
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/fFf08
function name:  test
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        TYPE_CHECK                                    2  ~1      !0
          2      > JMPNZ_EX                                         ~1      ~1, ->5
          3    >   IS_IDENTICAL                                     ~2      !0, ''
          4        BOOL                                             ~1      ~2
          5    > > JMPZ                                                     ~1, ->7
    5     6    > > RETURN                                                   <false>
    7     7    > > RETURN                                                   <true>
    8     8*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.73 ms | 1403 KiB | 18 Q