3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "Lorem IPSUM dolor sit amet, consectetur ipsum adipiscing elit."; $dolor = substr($a, 12, 5); echo "substr from position 15, 5 characters => ".$dolor."\n"; $elit = substr($a, -5, 4); echo "substr from position -5, 4 characters => ".$elit."\n"; // case sensitive $dolor_position = strpos($a, "dolor"); echo "strpos of dolor (case sensitive) => ".$dolor_position."\n"; // case insensitive $dolor_position_i = stripos($a, "dOLor"); echo "stripos of dOLlor (case insensitive) => ".$dolor_position_i."\n"; // case sensitive $new_a = str_replace("ipsum", "hello", $a); echo "str_replace ipsum (case sensitive) with hello => ".$new_a."\n"; // case insensitive $new_a = str_ireplace("ipsum", "hello", $a); echo "str_replace ipsum (case insensitive) with hello => ".$new_a."\n"; $len = strlen($a); echo "strlen (length) of a => ".$len."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FVgRN
function name:  (null)
number of ops:  59
compiled vars:  !0 = $a, !1 = $dolor, !2 = $elit, !3 = $dolor_position, !4 = $dolor_position_i, !5 = $new_a, !6 = $len
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Lorem+IPSUM+dolor+sit+amet%2C+consectetur+ipsum+adipiscing+elit.'
    5     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 12
          4        SEND_VAL                                                 5
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !1, $8
    6     7        CONCAT                                           ~10     'substr+from+position+15%2C+5+characters+%3D%3E+', !1
          8        CONCAT                                           ~11     ~10, '%0A'
          9        ECHO                                                     ~11
    8    10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 -5
         13        SEND_VAL                                                 4
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !2, $12
    9    16        CONCAT                                           ~14     'substr+from+position+-5%2C+4+characters+%3D%3E+', !2
         17        CONCAT                                           ~15     ~14, '%0A'
         18        ECHO                                                     ~15
   12    19        INIT_FCALL                                               'strpos'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 'dolor'
         22        DO_ICALL                                         $16     
         23        ASSIGN                                                   !3, $16
   13    24        CONCAT                                           ~18     'strpos+of+dolor+%28case+sensitive%29+%3D%3E+', !3
         25        CONCAT                                           ~19     ~18, '%0A'
         26        ECHO                                                     ~19
   16    27        INIT_FCALL                                               'stripos'
         28        SEND_VAR                                                 !0
         29        SEND_VAL                                                 'dOLor'
         30        DO_ICALL                                         $20     
         31        ASSIGN                                                   !4, $20
   17    32        CONCAT                                           ~22     'stripos+of+dOLlor+%28case+insensitive%29+%3D%3E+', !4
         33        CONCAT                                           ~23     ~22, '%0A'
         34        ECHO                                                     ~23
   20    35        INIT_FCALL                                               'str_replace'
         36        SEND_VAL                                                 'ipsum'
         37        SEND_VAL                                                 'hello'
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                         $24     
         40        ASSIGN                                                   !5, $24
   21    41        CONCAT                                           ~26     'str_replace+ipsum+%28case+sensitive%29+with+hello+%3D%3E+', !5
         42        CONCAT                                           ~27     ~26, '%0A'
         43        ECHO                                                     ~27
   24    44        INIT_FCALL                                               'str_ireplace'
         45        SEND_VAL                                                 'ipsum'
         46        SEND_VAL                                                 'hello'
         47        SEND_VAR                                                 !0
         48        DO_ICALL                                         $28     
         49        ASSIGN                                                   !5, $28
   25    50        CONCAT                                           ~30     'str_replace+ipsum+%28case+insensitive%29+with+hello+%3D%3E+', !5
         51        CONCAT                                           ~31     ~30, '%0A'
         52        ECHO                                                     ~31
   27    53        STRLEN                                           ~32     !0
         54        ASSIGN                                                   !6, ~32
   28    55        CONCAT                                           ~34     'strlen+%28length%29+of+a+%3D%3E+', !6
         56        CONCAT                                           ~35     ~34, '%0A'
         57        ECHO                                                     ~35
         58      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.27 ms | 1446 KiB | 18 Q