3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($data) { var_dump($data); var_dump(filter_var($data, FILTER_VALIDATE_INT)); echo PHP_EOL; } f(null); f(false); f(0); f("0"); f(1); f("1"); f(array()); f(array(0)); f(array(1)); class ToStringAble { function __toString() { return "0"; } } f(new ToStringAble()); f(new stdclass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y2L95
function name:  (null)
number of ops:  39
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'f'
          1        SEND_VAL                                                 null
          2        DO_FCALL                                      0          
   10     3        INIT_FCALL                                               'f'
          4        SEND_VAL                                                 <false>
          5        DO_FCALL                                      0          
   12     6        INIT_FCALL                                               'f'
          7        SEND_VAL                                                 0
          8        DO_FCALL                                      0          
   13     9        INIT_FCALL                                               'f'
         10        SEND_VAL                                                 '0'
         11        DO_FCALL                                      0          
   14    12        INIT_FCALL                                               'f'
         13        SEND_VAL                                                 1
         14        DO_FCALL                                      0          
   15    15        INIT_FCALL                                               'f'
         16        SEND_VAL                                                 '1'
         17        DO_FCALL                                      0          
   17    18        INIT_FCALL                                               'f'
         19        SEND_VAL                                                 <array>
         20        DO_FCALL                                      0          
   18    21        INIT_FCALL                                               'f'
         22        SEND_VAL                                                 <array>
         23        DO_FCALL                                      0          
   19    24        INIT_FCALL                                               'f'
         25        SEND_VAL                                                 <array>
         26        DO_FCALL                                      0          
   21    27        DECLARE_CLASS                                            'tostringable'
   27    28        INIT_FCALL                                               'f'
         29        NEW                                              $9      'ToStringAble'
         30        DO_FCALL                                      0          
         31        SEND_VAR                                                 $9
         32        DO_FCALL                                      0          
   28    33        INIT_FCALL                                               'f'
         34        NEW                                              $12     'stdclass'
         35        DO_FCALL                                      0          
         36        SEND_VAR                                                 $12
         37        DO_FCALL                                      0          
         38      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y2L95
function name:  f
number of ops:  13
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'filter_var'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 257
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                                 
    6    11        ECHO                                                     '%0A'
    7    12      > RETURN                                                   null

End of function f

Class ToStringAble:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y2L95
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E > > RETURN                                                   '0'
   24     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class ToStringAble.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.58 ms | 1445 KiB | 26 Q