3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 12.4444; var_dump(substr($number, strrchr($number, '.'), 1)); die; $decimal = strlen(substr($number, strpos($number, '.') + 1)); var_dump($decimal);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/lVEPY
function name:  (null)
number of ops:  29
compiled vars:  !0 = $number, !1 = $decimal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 12.4444
    7     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'strrchr'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 '.'
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
    8    13      > EXIT                                                     
   10    14*       INIT_FCALL                                               'substr'
         15*       SEND_VAR                                                 !0
         16*       INIT_FCALL                                               'strpos'
         17*       SEND_VAR                                                 !0
         18*       SEND_VAL                                                 '.'
         19*       DO_ICALL                                         $6      
         20*       ADD                                              ~7      $6, 1
         21*       SEND_VAL                                                 ~7
         22*       DO_ICALL                                         $8      
         23*       STRLEN                                           ~9      $8
         24*       ASSIGN                                                   !1, ~9
   11    25*       INIT_FCALL                                               'var_dump'
         26*       SEND_VAR                                                 !1
         27*       DO_ICALL                                                 
         28*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
208.42 ms | 1395 KiB | 21 Q