3v4l.org

run code in 500+ 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:  52
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                                                   'array_column'
         13        NEW                                                  $6      'ReflectionObject'
         14        SEND_VAR_EX                                                  !0
         15        DO_FCALL                                          0          
         16        INIT_METHOD_CALL                                             $6, 'getMethods'
         17        DO_FCALL                                          0  $8      
         18        SEND_VAR                                                     $8
         19        SEND_VAL                                                     'name'
         20        DO_ICALL                                             $9      
         21        FRAMELESS_ICALL_3                in_array            ~10     '__toString', $9
         22        OP_DATA                                                      <true>
         23        SEND_VAL                                                     ~10
         24        DO_ICALL                                                     
    7    25        ECHO                                                         '%0A'
    8    26        INIT_FCALL                                                   'var_dump'
         27        CAST                                              6  ~12     !0
         28        SEND_VAL                                                     ~12
         29        DO_ICALL                                                     
    9    30        INIT_FCALL                                                   'var_dump'
         31        CONCAT                                               ~14     '', !0
         32        SEND_VAL                                                     ~14
         33        DO_ICALL                                                     
   10    34        DECLARE_LAMBDA_FUNCTION                              ~16     [0]
         35        INIT_DYNAMIC_CALL                                            ~16
         36        SEND_VAR_EX                                                  !0
         37        DO_FCALL                                          0          
   11    38        ECHO                                                         '%0A'
   12    39        INIT_FCALL                                                   'var_dump'
         40        CAST                                              4  ~18     !0
         41        SEND_VAL                                                     ~18
         42        DO_ICALL                                                     
   13    43        INIT_FCALL                                                   'var_dump'
         44        MUL                                                  ~20     !0, 1
         45        SEND_VAL                                                     ~20
         46        DO_ICALL                                                     
   14    47        DECLARE_LAMBDA_FUNCTION                              ~22     [1]
         48        INIT_DYNAMIC_CALL                                            ~22
         49        SEND_VAR_EX                                                  !0
         50        DO_FCALL                                          0          
         51      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRnnW
function name:  {closure:/in/cRnnW:10}
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 Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRnnW
function name:  {closure:/in/cRnnW:14}
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 Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
185.68 ms | 1502 KiB | 15 Q