3v4l.org

run code in 300+ PHP versions simultaneously
<?php function toUpperCamelCase(string $text): string { $replacement = ""; $text = preg_replace("/(\b(de|du|la|le|et)\b)|(\b(l'|d')/gi)", ' ', $text); var_dump($text); // $text = delete_all_between('(', ')', $text); // var_dump($text); // $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); // var_dump($text); // $text = ucwords($text); // var_dump($text); // $text = preg_replace('~[^\pL\d]+~u', $replacement, $text); // var_dump($text); // $text = trim($text, $replacement); // var_dump($text); // $text = preg_replace('~-+~', $replacement, $text); // var_dump($text); return $text; } function delete_all_between(string $beginning, string $end, string $string): string { $beginningPos = strpos($string, $beginning); $endPos = strpos($string, $end); if ($beginningPos === false || $endPos === false) { return $string; } $textToDelete = substr($string, $beginningPos, ($endPos + strlen($end)) - $beginningPos); return str_replace($textToDelete, '', $string); } echo toUpperCamelCase("Identifiant de l’organisme destinataire de la déclaration néant");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PZWbm
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   INIT_FCALL                                               'touppercamelcase'
          1        SEND_VAL                                                 'Identifiant+de+l%E2%80%99organisme+destinataire+de+la+d%C3%A9claration+n%C3%A9ant'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function touppercamelcase:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PZWbm
function name:  toUpperCamelCase
number of ops:  15
compiled vars:  !0 = $text, !1 = $replacement
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, ''
    5     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%28%5Cb%28de%7Cdu%7Cla%7Cle%7Cet%29%5Cb%29%7C%28%5Cb%28l%27%7Cd%27%29%2Fgi%29'
          4        SEND_VAL                                                 '+'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
    6     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   22    11        VERIFY_RETURN_TYPE                                       !0
         12      > RETURN                                                   !0
   23    13*       VERIFY_RETURN_TYPE                                       
         14*     > RETURN                                                   null

End of function touppercamelcase

Function delete_all_between:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/PZWbm
function name:  delete_all_between
number of ops:  38
compiled vars:  !0 = $beginning, !1 = $end, !2 = $string, !3 = $beginningPos, !4 = $endPos, !5 = $textToDelete
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   27     3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !3, $6
   28     8        INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !4, $8
   29    13        TYPE_CHECK                                    4  ~10     !3
         14      > JMPNZ_EX                                         ~10     ~10, ->17
         15    >   TYPE_CHECK                                    4  ~11     !4
         16        BOOL                                             ~10     ~11
         17    > > JMPZ                                                     ~10, ->20
   30    18    >   VERIFY_RETURN_TYPE                                       !2
         19      > RETURN                                                   !2
   33    20    >   INIT_FCALL                                               'substr'
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !3
         23        STRLEN                                           ~12     !1
         24        ADD                                              ~13     !4, ~12
         25        SUB                                              ~14     ~13, !3
         26        SEND_VAL                                                 ~14
         27        DO_ICALL                                         $15     
         28        ASSIGN                                                   !5, $15
   35    29        INIT_FCALL                                               'str_replace'
         30        SEND_VAR                                                 !5
         31        SEND_VAL                                                 ''
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $17     
         34        VERIFY_RETURN_TYPE                                       $17
         35      > RETURN                                                   $17
   36    36*       VERIFY_RETURN_TYPE                                       
         37*     > RETURN                                                   null

End of function delete_all_between

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.47 ms | 1394 KiB | 24 Q