3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test ($affect) { if (![$affect]) { $affect = [$affect]; } var_dump($affect); } test('coucou'); test(['coucou']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4HBJW
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'test'
          1        SEND_VAL                                                 'coucou'
          2        DO_FCALL                                      0          
   13     3        INIT_FCALL                                               'test'
          4        SEND_VAL                                                 <array>
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/4HBJW
function name:  test
number of ops:  10
compiled vars:  !0 = $affect
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_ARRAY                                       ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->6
    5     4    >   INIT_ARRAY                                       ~3      !0
          5        ASSIGN                                                   !0, ~3
    8     6    >   INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   10     9      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.43 ms | 1397 KiB | 17 Q