3v4l.org

run code in 300+ PHP versions simultaneously
<?php $int = 20060627; $typehint = function ($int): float { return $int * 10; }; $class = new class { function float($num): float { return $num * 10; } }; class Foo { public function getW($val): float { return $val; } } var_dump(json_encode([(float)$int, $typehint($int), $class->float($int), (new Foo)->getW($int)])); echo floatval($int), PHP_EOL, $typehint($int);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DAQbV
function name:  (null)
number of ops:  37
compiled vars:  !0 = $int, !1 = $typehint, !2 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 20060627
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FDAQbV%3A4%240'
          2        ASSIGN                                                   !1, ~4
    8     3        DECLARE_ANON_CLASS                               <unknown> 
          4        NEW                                              $7      $6
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $7
   22     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'json_encode'
          9        CAST                                          5  ~10     !0
         10        INIT_ARRAY                                       ~11     ~10
         11        INIT_DYNAMIC_CALL                                        !1
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0  $12     
         14        ADD_ARRAY_ELEMENT                                ~11     $12
         15        INIT_METHOD_CALL                                         !2, 'float'
         16        SEND_VAR_EX                                              !0
         17        DO_FCALL                                      0  $13     
         18        ADD_ARRAY_ELEMENT                                ~11     $13
         19        NEW                                              $14     'Foo'
         20        DO_FCALL                                      0          
         21        INIT_METHOD_CALL                                         $14, 'getW'
         22        SEND_VAR_EX                                              !0
         23        DO_FCALL                                      0  $16     
         24        ADD_ARRAY_ELEMENT                                ~11     $16
         25        SEND_VAL                                                 ~11
         26        DO_ICALL                                         $17     
         27        SEND_VAR                                                 $17
         28        DO_ICALL                                                 
   23    29        CAST                                          5  ~19     !0
         30        ECHO                                                     ~19
         31        ECHO                                                     '%0A'
         32        INIT_DYNAMIC_CALL                                        !1
         33        SEND_VAR_EX                                              !0
         34        DO_FCALL                                      0  $20     
         35        ECHO                                                     $20
         36      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FDAQbV%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DAQbV
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        MUL                                              ~1      !0, 10
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
    6     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FDAQbV%3A4%240

Class class@anonymous:
Function float:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DAQbV
function name:  float
number of ops:  6
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        MUL                                              ~1      !0, 10
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
   12     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function float

End of class class@anonymous.

Class Foo:
Function getw:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DAQbV
function name:  getW
number of ops:  5
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        VERIFY_RETURN_TYPE                                       !0
          2      > RETURN                                                   !0
   19     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getw

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.79 ms | 1400 KiB | 17 Q