3v4l.org

run code in 300+ PHP versions simultaneously
<?php function experiment1($first, $two='') { echo $first . ' - ' . $two . "\n"; } function experiment2($first, $two='') { global $two; echo $first . ' - ' . $two . "\n"; } $two = 2; experiment1(1); experiment1(1, 3); experiment2(1); experiment2(1,3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q6ELo
function name:  (null)
number of ops:  16
compiled vars:  !0 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 2
   13     1        INIT_FCALL                                               'experiment1'
          2        SEND_VAL                                                 1
          3        DO_FCALL                                      0          
   14     4        INIT_FCALL                                               'experiment1'
          5        SEND_VAL                                                 1
          6        SEND_VAL                                                 3
          7        DO_FCALL                                      0          
   16     8        INIT_FCALL                                               'experiment2'
          9        SEND_VAL                                                 1
         10        DO_FCALL                                      0          
   17    11        INIT_FCALL                                               'experiment2'
         12        SEND_VAL                                                 1
         13        SEND_VAL                                                 3
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function experiment1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q6ELo
function name:  experiment1
number of ops:  7
compiled vars:  !0 = $first, !1 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
    3     2        CONCAT                                           ~2      !0, '++-++'
          3        CONCAT                                           ~3      ~2, !1
          4        CONCAT                                           ~4      ~3, '%0A'
          5        ECHO                                                     ~4
    4     6      > RETURN                                                   null

End of function experiment1

Function experiment2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q6ELo
function name:  experiment2
number of ops:  8
compiled vars:  !0 = $first, !1 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
    7     2        BIND_GLOBAL                                              !1, 'two'
    8     3        CONCAT                                           ~2      !0, '++-++'
          4        CONCAT                                           ~3      ~2, !1
          5        CONCAT                                           ~4      ~3, '%0A'
          6        ECHO                                                     ~4
    9     7      > RETURN                                                   null

End of function experiment2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180 ms | 1399 KiB | 17 Q