3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($ok) { if ($ok) { return array('foo', 42); } return null; } foreach (array(true, false) as $ok) { list($a, $b) = foo($ok); printf("a: %s; b: %s\n", json_encode($a), json_encode($b)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 22
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 22
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/o5ocb
function name:  (null)
number of ops:  24
compiled vars:  !0 = $ok, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > FE_RESET_R                                       $3      <array>, ->22
          1    > > FE_FETCH_R                                               $3, !0, ->22
   12     2    >   INIT_FCALL                                               'foo'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $4      
          5        FETCH_LIST_R                                     $5      $4, 0
          6        ASSIGN                                                   !1, $5
          7        FETCH_LIST_R                                     $7      $4, 1
          8        ASSIGN                                                   !2, $7
          9        FREE                                                     $4
   13    10        INIT_FCALL                                               'printf'
         11        SEND_VAL                                                 'a%3A+%25s%3B+b%3A+%25s%0A'
         12        INIT_FCALL                                               'json_encode'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $9      
         15        SEND_VAR                                                 $9
         16        INIT_FCALL                                               'json_encode'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
   11    21      > JMP                                                      ->1
         22    >   FE_FREE                                                  $3
   14    23      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 3
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o5ocb
function name:  foo
number of ops:  5
compiled vars:  !0 = $ok
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > JMPZ                                                     !0, ->3
    5     2    > > RETURN                                                   <array>
    7     3    > > RETURN                                                   null
    8     4*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.85 ms | 1390 KiB | 18 Q