3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function double(int $value) { return 2 * $value; } function coerceInt(string $value) : int { return (int)$value; } $a = double(coerceInt("5")); var_dump($a); $a = double("5"); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VhnpM
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'double'
          1        INIT_FCALL                                               'coerceint'
          2        SEND_VAL                                                 '5'
          3        DO_FCALL                                      0  $1      
          4        SEND_VAR                                                 $1
          5        DO_FCALL                                      0  $2      
          6        ASSIGN                                                   !0, $2
   14     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   15    10        INIT_FCALL                                               'double'
         11        SEND_VAL                                                 '5'
         12        DO_FCALL                                      0  $5      
         13        ASSIGN                                                   !0, $5
   16    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function double:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VhnpM
function name:  double
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        MUL                                              ~1      !0, 2
          2      > RETURN                                                   ~1
    7     3*     > RETURN                                                   null

End of function double

Function coerceint:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VhnpM
function name:  coerceInt
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        CAST                                          4  ~1      !0
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
   12     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function coerceint

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.01 ms | 1399 KiB | 18 Q