3v4l.org

run code in 300+ PHP versions simultaneously
<?php $gmp = gmp_init('42'); var_dump($gmp); var_dump($gmp instanceof Stringable); var_dump(in_array('__toString', array_column((new ReflectionObject($gmp))->getMethods(), 'name'), true)); echo "\n"; var_dump((string)$gmp); var_dump(''.$gmp); (function (string $x) { var_dump($x); })($gmp); echo "\n"; var_dump((int)$gmp); var_dump(+$gmp); (function (int $x) { var_dump($x); })($gmp);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRnnW
function name:  (null)
number of ops:  55
compiled vars:  !0 = $gmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'gmp_init'
          1        SEND_VAL_EX                                              '42'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
    4     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
    5     7        INIT_FCALL                                               'var_dump'
          8        INSTANCEOF                                       ~4      !0, 'Stringable'
          9        SEND_VAL                                                 ~4
         10        DO_ICALL                                                 
    6    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'in_array'
         13        SEND_VAL                                                 '__toString'
         14        INIT_FCALL                                               'array_column'
         15        NEW                                              $6      'ReflectionObject'
         16        SEND_VAR_EX                                              !0
         17        DO_FCALL                                      0          
         18        INIT_METHOD_CALL                                         $6, 'getMethods'
         19        DO_FCALL                                      0  $8      
         20        SEND_VAR                                                 $8
         21        SEND_VAL                                                 'name'
         22        DO_ICALL                                         $9      
         23        SEND_VAR                                                 $9
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $10     
         26        SEND_VAR                                                 $10
         27        DO_ICALL                                                 
    7    28        ECHO                                                     '%0A'
    8    29        INIT_FCALL                                               'var_dump'
         30        CAST                                          6  ~12     !0
         31        SEND_VAL                                                 ~12
         32        DO_ICALL                                                 
    9    33        INIT_FCALL                                               'var_dump'
         34        CONCAT                                           ~14     '', !0
         35        SEND_VAL                                                 ~14
         36        DO_ICALL                                                 
   10    37        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcRnnW%3A10%240'
         38        INIT_DYNAMIC_CALL                                        ~16
         39        SEND_VAR_EX                                              !0
         40        DO_FCALL                                      0          
   11    41        ECHO                                                     '%0A'
   12    42        INIT_FCALL                                               'var_dump'
         43        CAST                                          4  ~18     !0
         44        SEND_VAL                                                 ~18
         45        DO_ICALL                                                 
   13    46        INIT_FCALL                                               'var_dump'
         47        MUL                                              ~20     !0, 1
         48        SEND_VAL                                                 ~20
         49        DO_ICALL                                                 
   14    50        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcRnnW%3A14%241'
         51        INIT_DYNAMIC_CALL                                        ~22
         52        SEND_VAR_EX                                              !0
         53        DO_FCALL                                      0          
         54      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcRnnW%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRnnW
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcRnnW%3A10%240

Function %00%7Bclosure%7D%2Fin%2FcRnnW%3A14%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRnnW
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcRnnW%3A14%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.93 ms | 1400 KiB | 19 Q