3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(substr($number, strrchr($number, '.') + 1)); die; $number = 12.4444; $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/Z0jI4
function name:  (null)
number of ops:  29
compiled vars:  !0 = $number, !1 = $decimal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        INIT_FCALL                                               'strrchr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 '.'
          6        DO_ICALL                                         $2      
          7        ADD                                              ~3      $2, 1
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
    7    12      > EXIT                                                     
    9    13*       ASSIGN                                                   !0, 12.4444
   10    14*       INIT_FCALL                                               'substr'
         15*       SEND_VAR                                                 !0
         16*       INIT_FCALL                                               'strpos'
         17*       SEND_VAR                                                 !0
         18*       SEND_VAL                                                 '.'
         19*       DO_ICALL                                         $7      
         20*       ADD                                              ~8      $7, 1
         21*       SEND_VAL                                                 ~8
         22*       DO_ICALL                                         $9      
         23*       STRLEN                                           ~10     $9
         24*       ASSIGN                                                   !1, ~10
   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:
159.44 ms | 1395 KiB | 21 Q