3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(&$error) { $response = (object)array(); $fail = function($err) { $error[] = $err; return $response; }; return $fail('invalid derp'); } $error = array(); $response = $test($error); var_dump($error);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YQftF
function name:  (null)
number of ops:  9
compiled vars:  !0 = $error, !1 = $response, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_DYNAMIC_CALL                                        !2
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   16     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YQftF
function name:  test
number of ops:  10
compiled vars:  !0 = $error, !1 = $response, !2 = $fail
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        CAST                                          8  ~3      <array>
          2        ASSIGN                                                   !1, ~3
    6     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYQftF%3A6%240'
          4        ASSIGN                                                   !2, ~5
   11     5        INIT_DYNAMIC_CALL                                        !2
          6        SEND_VAL_EX                                              'invalid+derp'
          7        DO_FCALL                                      0  $7      
          8      > RETURN                                                   $7
   12     9*     > RETURN                                                   null

End of function test

Function %00%7Bclosure%7D%2Fin%2FYQftF%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YQftF
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $err, !1 = $error, !2 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_DIM                                               !1
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   !2
    9     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYQftF%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.88 ms | 1396 KiB | 15 Q