3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "resource_id_heeelp_lala_klopsiki"; preg_match_all('/(_[\w]{1})/', $string, $matches); if(!empty($matches[0])){ foreach($matches[0] as $key){ $result = substr($key, 1, 1); //result is c print $result; //$result1=str_replace($result,'',$key);//now your result1 is apitalize //$result2=ucfirst($result1); //now result2 is Apitalize //$finalresult=$result.$result2; ///now your finalresult is cApitalize preg_replace("/".$key."/", ucfirst($result), $string); } } print $string;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 31
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 30
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 30
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 31
filename:       /in/IlL89
function name:  (null)
number of ops:  33
compiled vars:  !0 = $string, !1 = $matches, !2 = $key, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'resource_id_heeelp_lala_klopsiki'
    3     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%28_%5B%5Cw%5D%7B1%7D%29%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    4     6        ISSET_ISEMPTY_DIM_OBJ                         1  ~6      !1, 0
          7        BOOL_NOT                                         ~7      ~6
          8      > JMPZ                                                     ~7, ->31
    5     9    >   FETCH_DIM_R                                      ~8      !1, 0
         10      > FE_RESET_R                                       $9      ~8, ->30
         11    > > FE_FETCH_R                                               $9, !2, ->30
    7    12    >   INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 1
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !3, $10
    8    18        ECHO                                                     !3
   13    19        INIT_FCALL                                               'preg_replace'
         20        CONCAT                                           ~12     '%2F', !2
         21        CONCAT                                           ~13     ~12, '%2F'
         22        SEND_VAL                                                 ~13
         23        INIT_FCALL                                               'ucfirst'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                         $14     
         26        SEND_VAR                                                 $14
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
    5    29      > JMP                                                      ->11
         30    >   FE_FREE                                                  $9
   16    31    >   ECHO                                                     !0
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.93 ms | 1396 KiB | 21 Q