3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dePercent($value) { $number = preg_replace("/[^0-9.]/", "", $value); if (strpos($value,'%') !== FALSE) { return intval($number)*.01; } return $number; } dePercent("%5");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PRQmv
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'depercent'
          1        SEND_VAL                                                 '%255'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function depercent:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PRQmv
function name:  dePercent
number of ops:  18
compiled vars:  !0 = $value, !1 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%5E0-9.%5D%2F'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !1, $2
    5     7        INIT_FCALL                                               'strpos'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 '%25'
         10        DO_ICALL                                         $4      
         11        TYPE_CHECK                                  1018          $4
         12      > JMPZ                                                     ~5, ->16
    6    13    >   CAST                                          4  ~6      !1
         14        MUL                                              ~7      ~6, 0.01
         15      > RETURN                                                   ~7
    8    16    > > RETURN                                                   !1
    9    17*     > RETURN                                                   null

End of function depercent

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.44 ms | 1389 KiB | 18 Q