3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($s) { return strtoupper(trim($s)); } function bar($s) { $s = trim($s); $s = strtoupper($s); return $s; } $x = " Hello! "; var_dump(foo($x)); var_dump(bar($x));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FjWP9
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, '++Hello%21+'
   15     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'foo'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   16     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'bar'
          9        SEND_VAR                                                 !0
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FjWP9
function name:  foo
number of ops:  9
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'strtoupper'
          2        INIT_FCALL                                               'trim'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
    5     8*     > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FjWP9
function name:  bar
number of ops:  11
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   10     5        INIT_FCALL                                               'strtoupper'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !0, $3
   11     9      > RETURN                                                   !0
   12    10*     > RETURN                                                   null

End of function bar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.69 ms | 1399 KiB | 21 Q