3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Convert spaces to dash and LowerCase with PHP'; $str_lower = strtolower($str); $separator = '-'; $str_replace = str_replace(' ', $separator, $str_lower); $wordwrap = wordwrap($str_lower, 1, $separator, 0); echo 'Original: ' . "\t" . $str . "\n"; echo 'str_lower: ' . "\t" . $str_lower . "\n"; echo 'str_replace: ' . "\t" . $str_replace . "\n"; echo 'wordwrap: ' . "\t" . $wordwrap . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/keWGr
function name:  (null)
number of ops:  32
compiled vars:  !0 = $str, !1 = $str_lower, !2 = $separator, !3 = $str_replace, !4 = $wordwrap
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Convert+spaces+to+dash+and+LowerCase+with+PHP'
    4     1        INIT_FCALL                                               'strtolower'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    5     5        ASSIGN                                                   !2, '-'
    7     6        INIT_FCALL                                               'str_replace'
          7        SEND_VAL                                                 '+'
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !3, $9
    8    12        INIT_FCALL                                               'wordwrap'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 1
         15        SEND_VAR                                                 !2
         16        SEND_VAL                                                 0
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !4, $11
   10    19        CONCAT                                           ~13     'Original%3A+%09', !0
         20        CONCAT                                           ~14     ~13, '%0A'
         21        ECHO                                                     ~14
   12    22        CONCAT                                           ~15     'str_lower%3A+%09', !1
         23        CONCAT                                           ~16     ~15, '%0A'
         24        ECHO                                                     ~16
   14    25        CONCAT                                           ~17     'str_replace%3A+%09', !3
         26        CONCAT                                           ~18     ~17, '%0A'
         27        ECHO                                                     ~18
   16    28        CONCAT                                           ~19     'wordwrap%3A+%09', !4
         29        CONCAT                                           ~20     ~19, '%0A'
         30        ECHO                                                     ~20
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
273.48 ms | 1013 KiB | 16 Q