3v4l.org

run code in 300+ PHP versions simultaneously
<?php $texthtml = '<p>test</p><br><p><img src="1.jpeg" alt=""><br></p><p><img src="2.png" alt=""><br><img src="3.png" alt=""></p>'; $search = 'img src="'; $pos = strpos($texthtml, $search)+ strlen($search); $lenght= strpos($texthtml, '"', $pos)-$pos; echo substr($texthtml, $pos, $lenght);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/48iiI
function name:  (null)
number of ops:  23
compiled vars:  !0 = $texthtml, !1 = $search, !2 = $pos, !3 = $lenght
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cp%3Etest%3C%2Fp%3E%3Cbr%3E%3Cp%3E%3Cimg+src%3D%221.jpeg%22+alt%3D%22%22%3E%3Cbr%3E%3C%2Fp%3E%3Cp%3E%3Cimg+src%3D%222.png%22+alt%3D%22%22%3E%3Cbr%3E%3Cimg+src%3D%223.png%22+alt%3D%22%22%3E%3C%2Fp%3E'
    4     1        ASSIGN                                                   !1, 'img+src%3D%22'
    5     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        STRLEN                                           ~7      !1
          7        ADD                                              ~8      $6, ~7
          8        ASSIGN                                                   !2, ~8
    6     9        INIT_FCALL                                               'strpos'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 '%22'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $10     
         14        SUB                                              ~11     $10, !2
         15        ASSIGN                                                   !3, ~11
    8    16        INIT_FCALL                                               'substr'
         17        SEND_VAR                                                 !0
         18        SEND_VAR                                                 !2
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $13     
         21        ECHO                                                     $13
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.21 ms | 1006 KiB | 15 Q