3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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_numeric($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"; }
based on Tdifg
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/pg3nF
function name:  (null)
number of ops:  32
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%2Fpg3nF0x7fe01a78809e'
         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%2Fpg3nF0x7fe01a7880cb'
         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%2Fpg3nF0x7fe01a7880fe'
        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%2Fpg3nF0x7fe01a78812d'
        18        SEND_VAL_EX                                              ~6
        19        DO_FCALL                                      0          
  16    20        INIT_FCALL_BY_NAME                                       'test'
        21        SEND_VAL_EX                                              'pie'
        22        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a78815b'
        23        SEND_VAL_EX                                              ~8
        24        DO_FCALL                                      0          
  17    25        INIT_FCALL_BY_NAME                                       'test'
        26        SEND_VAL_EX                                              'pie'
        27        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a788187'
        28        SEND_VAL_EX                                              ~10
        29        DO_FCALL                                      0          
  19    30        NOP                                                      
  27    31      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a78809e:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/pg3nF
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%2Fpg3nF0x7fe01a78809e

Function %00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a7880cb:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/pg3nF
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%2Fpg3nF0x7fe01a7880cb

Function %00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a7880fe:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/pg3nF
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  14     0  E >   RECV                                             !0      
         1        INIT_FCALL                                               'is_numeric'
         2        SEND_VAR                                                 !0
         3        DO_ICALL                                         $1      
         4      > RETURN                                                   $1
         5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a7880fe

Function %00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a78812d:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/pg3nF
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        IS_EQUAL                                         ~1      !0, '15'
         2      > RETURN                                                   ~1
         3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a78812d

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

End of function %00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a78815b

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

End of function %00%7Bclosure%7D%2Fin%2Fpg3nF0x7fe01a788187

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

End of function test

Generated using Vulcan Logic Dumper, using php 7.2.0