3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* $a = '0xf'; $b = '15'; $c = 15; var_dump('Vars', $a, $b, $c); var_dump('EQ', $a == $b, $a == $c, $b == $c); */ test('pie', function($a){return $a;}); test('pie', function($a){return $a == 15;}); test('pie', function($a){return is_int($a);}); 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/M8LPu
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL_BY_NAME                                       'test'
          1        SEND_VAL_EX                                              'pie'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FM8LPu%3A12%240'
          3        SEND_VAL_EX                                              ~0
          4        DO_FCALL                                      0          
   13     5        INIT_FCALL_BY_NAME                                       'test'
          6        SEND_VAL_EX                                              'pie'
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FM8LPu%3A13%241'
          8        SEND_VAL_EX                                              ~2
          9        DO_FCALL                                      0          
   14    10        INIT_FCALL_BY_NAME                                       'test'
         11        SEND_VAL_EX                                              'pie'
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FM8LPu%3A14%242'
         13        SEND_VAL_EX                                              ~4
         14        DO_FCALL                                      0          
   15    15        INIT_FCALL_BY_NAME                                       'test'
         16        SEND_VAL_EX                                              'pie'
         17        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FM8LPu%3A15%243'
         18        SEND_VAL_EX                                              ~6
         19        DO_FCALL                                      0          
   25    20      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FM8LPu%3A12%240

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

End of function %00%7Bclosure%7D%2Fin%2FM8LPu%3A13%241

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

End of function %00%7Bclosure%7D%2Fin%2FM8LPu%3A14%242

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

End of function %00%7Bclosure%7D%2Fin%2FM8LPu%3A15%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/M8LPu
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
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        BIND_STATIC                                              !2
   19     3        ECHO                                                     !0
   20     4      > FE_RESET_R                                       $5      !2, ->18
          5    > > FE_FETCH_R                                       ~6      $5, !3, ->18
          6    >   ASSIGN                                                   !4, ~6
   21     7        ROPE_INIT                                     3  ~9      '+++'
          8        ROPE_ADD                                      1  ~9      ~9, !4
          9        ROPE_END                                      2  ~8      ~9, '+%3D%3E+'
         10        ECHO                                                     ~8
   22    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                                                 
   20    17      > JMP                                                      ->5
         18    >   FE_FREE                                                  $5
   24    19        ECHO                                                     '%0A'
   25    20      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.64 ms | 1400 KiB | 15 Q