3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("apples", "oranges", "plums"); $nu = array_map( "do_something", $array); function do_something($item) { if($item == 'plums') { $item = 's'; } return $item; } var_dump($nu); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sdN9a
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array, !1 = $nu
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_map'
          2        SEND_VAL                                                 'do_something'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   13     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   14     9      > RETURN                                                   1

Function do_something:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/sdN9a
function name:  do_something
number of ops:  6
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        IS_EQUAL                                                 !0, 'plums'
          2      > JMPZ                                                     ~1, ->4
    8     3    >   ASSIGN                                                   !0, 's'
   10     4    > > RETURN                                                   !0
   11     5*     > RETURN                                                   null

End of function do_something

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.19 ms | 1395 KiB | 17 Q