3v4l.org

run code in 300+ PHP versions simultaneously
<?php test('pie', function($a){return $a;}); test('pie', function($a){return $a == 15;}); test('pie', function($a){return $a === 15;}); test('pie', function($a){return (int)$a;}); function test($label, $lambda){ static $a = ['hex' => '0xf', 'str' => '15', 'int' => 15]; echo $label; foreach($a AS $k=>$v) { echo " $k => "; var_export($lambda($v)); } echo "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NPdNI
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'test'
          1        SEND_VAL_EX                                              'pie'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNPdNI%3A3%240'
          3        SEND_VAL_EX                                              ~0
          4        DO_FCALL                                      0          
    4     5        INIT_FCALL_BY_NAME                                       'test'
          6        SEND_VAL_EX                                              'pie'
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNPdNI%3A4%241'
          8        SEND_VAL_EX                                              ~2
          9        DO_FCALL                                      0          
    5    10        INIT_FCALL_BY_NAME                                       'test'
         11        SEND_VAL_EX                                              'pie'
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNPdNI%3A5%242'
         13        SEND_VAL_EX                                              ~4
         14        DO_FCALL                                      0          
    6    15        INIT_FCALL_BY_NAME                                       'test'
         16        SEND_VAL_EX                                              'pie'
         17        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNPdNI%3A6%243'
         18        SEND_VAL_EX                                              ~6
         19        DO_FCALL                                      0          
   16    20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FNPdNI%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NPdNI
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

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

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

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

Function %00%7Bclosure%7D%2Fin%2FNPdNI%3A5%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NPdNI
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        IS_IDENTICAL                                     ~1      !0, 15
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNPdNI%3A5%242

Function %00%7Bclosure%7D%2Fin%2FNPdNI%3A6%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NPdNI
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        CAST                                          4  ~1      !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNPdNI%3A6%243

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/NPdNI
function name:  test
number of ops:  21
compiled vars:  !0 = $label, !1 = $lambda, !2 = $a, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        BIND_STATIC                                              !2
   10     3        ECHO                                                     !0
   11     4      > FE_RESET_R                                       $5      !2, ->18
          5    > > FE_FETCH_R                                       ~6      $5, !3, ->18
          6    >   ASSIGN                                                   !4, ~6
   12     7        ROPE_INIT                                     3  ~9      '+++'
          8        ROPE_ADD                                      1  ~9      ~9, !4
          9        ROPE_END                                      2  ~8      ~9, '+%3D%3E+'
         10        ECHO                                                     ~8
   13    11        INIT_FCALL                                               'var_export'
         12        INIT_DYNAMIC_CALL                                        !1
         13        SEND_VAR_EX                                              !3
         14        DO_FCALL                                      0  $11     
         15        SEND_VAR                                                 $11
         16        DO_ICALL                                                 
   11    17      > JMP                                                      ->5
         18    >   FE_FREE                                                  $5
   15    19        ECHO                                                     '%0A'
   16    20      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.07 ms | 1400 KiB | 15 Q