3v4l.org

run code in 300+ PHP versions simultaneously
<?php $authenticationCheck = function ($required) { return function () use ($required) { if ( $required|| !$required ) { echo 'home'; } }; }; $autheticated = function () use ($authenticationCheck) { return $authenticationCheck(true); }; $guest = function () use ($authenticationCheck) { return $authenticationCheck(false); }; echo $guest();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GT4kK
function name:  (null)
number of ops:  12
compiled vars:  !0 = $authenticationCheck, !1 = $autheticated, !2 = $guest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGT4kK%3A3%240'
          1        ASSIGN                                                   !0, ~3
   15     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGT4kK%3A15%242'
          3        BIND_LEXICAL                                             ~5, !0
          4        ASSIGN                                                   !1, ~5
   19     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGT4kK%3A19%243'
          6        BIND_LEXICAL                                             ~7, !0
          7        ASSIGN                                                   !2, ~7
   24     8        INIT_DYNAMIC_CALL                                        !2
          9        DO_FCALL                                      0  $9      
         10        ECHO                                                     $9
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FGT4kK%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GT4kK
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $required
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FGT4kK%3A4%241'
          2        BIND_LEXICAL                                             ~1, !0
   12     3      > RETURN                                                   ~1
   13     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGT4kK%3A3%240

Function %00%7Bclosure%7D%2Fin%2FGT4kK%3A4%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
Branch analysis from position: 4
filename:       /in/GT4kK
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $required
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    6     1      > JMPNZ_EX                                         ~1      !0, ->4
          2    >   BOOL_NOT                                         ~2      !0
          3        BOOL                                             ~1      ~2
          4    > > JMPZ                                                     ~1, ->6
   10     5    >   ECHO                                                     'home'
   12     6    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGT4kK%3A4%241

Function %00%7Bclosure%7D%2Fin%2FGT4kK%3A15%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GT4kK
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $authenticationCheck
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   BIND_STATIC                                              !0
   16     1        INIT_DYNAMIC_CALL                                        !0
          2        SEND_VAL_EX                                              <true>
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   17     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGT4kK%3A15%242

Function %00%7Bclosure%7D%2Fin%2FGT4kK%3A19%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GT4kK
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $authenticationCheck
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   BIND_STATIC                                              !0
   20     1        INIT_DYNAMIC_CALL                                        !0
          2        SEND_VAL_EX                                              <false>
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   21     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FGT4kK%3A19%243

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.19 ms | 1399 KiB | 13 Q