3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = $b = function($newfoo = NULL) { static $foo = "origfoo"; if ($newfoo !== NULL) { $foo = $newfoo; } print $foo . "\n"; }; $a(); $a("some other foo"); $b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uQSsk
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuQSsk%3A2%240'
          1        ASSIGN                                           ~3      !1, ~2
          2        ASSIGN                                                   !0, ~3
   10     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
   11     5        INIT_DYNAMIC_CALL                                        !0
          6        SEND_VAL_EX                                              'some+other+foo'
          7        DO_FCALL                                      0          
   12     8        INIT_DYNAMIC_CALL                                        !1
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FuQSsk%3A2%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/uQSsk
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $newfoo, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      null
    3     1        BIND_STATIC                                              !1
    4     2        TYPE_CHECK                                  1020          !0
          3      > JMPZ                                                     ~2, ->5
    5     4    >   ASSIGN                                                   !1, !0
    7     5    >   CONCAT                                           ~4      !1, '%0A'
          6        ECHO                                                     ~4
    8     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FuQSsk%3A2%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.16 ms | 1394 KiB | 13 Q