3v4l.org

run code in 300+ PHP versions simultaneously
<?php // php 5.3.0+ $initial = 'PROP_RESOURCE_TYPE'; $words = explode('_', $initial); foreach($words as &$word){ $word = ucfirst(strtolower($word)); } $final = implode($words); echo $final; // returns PropResourceType // if you want a lowercase first letter just do echo lcfirst($final); // returns propResourceType
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/9S3Oo
function name:  (null)
number of ops:  27
compiled vars:  !0 = $initial, !1 = $words, !2 = $word, !3 = $final
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'PROP_RESOURCE_TYPE'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '_'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6      > FE_RESET_RW                                      $7      !1, ->16
          7    > > FE_FETCH_RW                                              $7, !2, ->16
    7     8    >   INIT_FCALL                                               'ucfirst'
          9        INIT_FCALL                                               'strtolower'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !2, $9
    6    15      > JMP                                                      ->7
         16    >   FE_FREE                                                  $7
    9    17        INIT_FCALL                                               'implode'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !3, $11
   10    21        ECHO                                                     !3
   14    22        INIT_FCALL                                               'lcfirst'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $13     
         25        ECHO                                                     $13
   15    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.77 ms | 1395 KiB | 23 Q