3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var1 = 123; $var2 = '456A'; $var3 = 789; echo to_number($var1) . "\n"; echo to_number($var2) . "\n"; echo to_number($var3) . "\n"; # convert var to number function to_number($var) { return 0 + $var; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oEKPD
function name:  (null)
number of ops:  19
compiled vars:  !0 = $var1, !1 = $var2, !2 = $var3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 123
    5     1        ASSIGN                                                   !1, '456A'
    6     2        ASSIGN                                                   !2, 789
    8     3        INIT_FCALL_BY_NAME                                       'to_number'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $6      
          6        CONCAT                                           ~7      $6, '%0A'
          7        ECHO                                                     ~7
    9     8        INIT_FCALL_BY_NAME                                       'to_number'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $8      
   10    11        CONCAT                                           ~9      $8, '%0A'
         12        ECHO                                                     ~9
   11    13        INIT_FCALL_BY_NAME                                       'to_number'
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $10     
         16        CONCAT                                           ~11     $10, '%0A'
         17        ECHO                                                     ~11
   17    18      > RETURN                                                   1

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

End of function to_number

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.12 ms | 1394 KiB | 13 Q