3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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);
based on dONJL
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/QJjIh
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   NOP                                                      
   9     1        NOP                                                      
  13     2        INIT_FCALL                                               'double'
         3        INIT_FCALL                                               'coerceint'
         4        SEND_VAL                                                 '5'
         5        DO_FCALL                                      0  $1      
         6        SEND_VAR                                                 $1
         7        DO_FCALL                                      0  $2      
         8        ASSIGN                                                   !0, $2
  14     9        INIT_FCALL                                               'var_dump'
        10        SEND_VAR                                                 !0
        11        DO_ICALL                                                 
        12      > RETURN                                                   1

Function double:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/QJjIh
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      2, !0
         2      > RETURN                                                   ~1
   7     3*     > RETURN                                                   null

End of function double

Function coerceint:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/QJjIh
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 7.3.0