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/cWTId
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        ADD                                              ~4      $3, 1
          9        SEND_VAL                                                 ~4
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         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                                         $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:
163.06 ms | 1395 KiB | 21 Q