3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Drive_Filter_NormalizeName // implements Zend_Filter_Interface { protected function _replace(array $match) { return sprintf("%012d%s", $match[1], isset($match[2]) ? $match[2] : ''); } public function filter($name) { if (function_exists('mb_strtolower')) { $name = mb_strtolower($name); } else { $name = strtolower($name); } $name = preg_replace_callback('/(\d+)([.,]\d+)?/', array($this, '_replace'), $name); return $name; } } $filter = new Drive_Filter_NormalizeName; echo $filter->filter('Dupa5_5.23_DÓpa3');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cq5E4
function name:  (null)
number of ops:  8
compiled vars:  !0 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'Drive_Filter_NormalizeName'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'filter'
          4        SEND_VAL_EX                                              'Dupa5_5.23_D%C3%93pa3'
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

Class Drive_Filter_NormalizeName:
Function _replace:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cq5E4
function name:  _replace
number of ops:  15
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%25012d%25s'
          3        FETCH_DIM_R                                      ~1      !0, 1
          4        SEND_VAL                                                 ~1
          5        ISSET_ISEMPTY_DIM_OBJ                         0          !0, 2
          6      > JMPZ                                                     ~2, ->10
          7    >   FETCH_DIM_R                                      ~3      !0, 2
          8        QM_ASSIGN                                        ~4      ~3
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~4      ''
         11    >   SEND_VAL                                                 ~4
         12        DO_ICALL                                         $5      
         13      > RETURN                                                   $5
    8    14*     > RETURN                                                   null

End of function _replace

Function filter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cq5E4
function name:  filter
number of ops:  25
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'function_exists'
          2        SEND_VAL                                                 'mb_strtolower'
          3        DO_ICALL                                         $1      
          4      > JMPZ                                                     $1, ->10
   13     5    >   INIT_FCALL                                               'mb_strtolower'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $2      
          8        ASSIGN                                                   !0, $2
          9      > JMP                                                      ->14
   15    10    >   INIT_FCALL                                               'strtolower'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $4      
         13        ASSIGN                                                   !0, $4
   18    14    >   INIT_FCALL                                               'preg_replace_callback'
         15        SEND_VAL                                                 '%2F%28%5Cd%2B%29%28%5B.%2C%5D%5Cd%2B%29%3F%2F'
         16        FETCH_THIS                                       ~6      
         17        INIT_ARRAY                                       ~7      ~6
         18        ADD_ARRAY_ELEMENT                                ~7      '_replace'
         19        SEND_VAL                                                 ~7
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $8      
         22        ASSIGN                                                   !0, $8
   20    23      > RETURN                                                   !0
   21    24*     > RETURN                                                   null

End of function filter

End of class Drive_Filter_NormalizeName.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.23 ms | 1400 KiB | 23 Q