3v4l.org

run code in 300+ PHP versions simultaneously
<?php $desiredOutput = <<<'EOD' <!-- TRAJET --> <h3>Votre trajet</h2> <div class="septraf"> </div> <p><span style="text-decoration: underline;">Dans les 2 sens</span> :<br />- arrêt Mimosas reporté à l'arrêt provisoire placé route de Vannes au niveau de la station essence<br />- arrêt Cravate reporté à l'arrêt Ferrière</p> EOD; $pattern = '/\s?<p>(\s|\xc2\xa0|&nbsp;)*<\/p>/'; $str = <<<'EOD' <!-- TRAJET --> <h3>Votre trajet</h2> <div class="septraf"> </div> <p><span style="text-decoration: underline;">Dans les 2 sens</span> :<br />- arrêt Mimosas reporté à l'arrêt provisoire placé route de Vannes au niveau de la station essence<br />- arrêt Cravate reporté à l'arrêt Ferrière</p> <p> </p> EOD; $str = preg_replace($pattern, '', $str); echo ($str === $desiredOutput ? 'Matches' : 'Failed') . ' <p> </p>' . \PHP_EOL; $str = <<<'EOD' <!-- TRAJET --> <h3>Votre trajet</h2> <div class="septraf"> </div> <p><span style="text-decoration: underline;">Dans les 2 sens</span> :<br />- arrêt Mimosas reporté à l'arrêt provisoire placé route de Vannes au niveau de la station essence<br />- arrêt Cravate reporté à l'arrêt Ferrière</p> <p>&nbsp;</p> EOD; $str = preg_replace($pattern, '', $str); echo ($str === $desiredOutput ? 'Matches' : 'Failed') . ' <p>&nbsp;</p>' . \PHP_EOL; $str = <<<'EOD' <!-- TRAJET --> <h3>Votre trajet</h2> <div class="septraf"> </div> <p><span style="text-decoration: underline;">Dans les 2 sens</span> :<br />- arrêt Mimosas reporté à l'arrêt provisoire placé route de Vannes au niveau de la station essence<br />- arrêt Cravate reporté à l'arrêt Ferrière</p> <p>&nbsp; </p> EOD; $str = preg_replace($pattern, '', $str); echo ($str === $desiredOutput ? 'Matches' : 'Failed') . ' <p>&nbsp;</p>' . \PHP_EOL; $str = <<<'EOD' <!-- TRAJET --> <h3>Votre trajet</h2> <div class="septraf"> </div> <p><span style="text-decoration: underline;">Dans les 2 sens</span> :<br />- arrêt Mimosas reporté à l'arrêt provisoire placé route de Vannes au niveau de la station essence<br />- arrêt Cravate reporté à l'arrêt Ferrière</p> <p> &nbsp; </p> EOD; $str = preg_replace($pattern, '', $str); echo ($str === $desiredOutput ? 'Matches' : 'Failed') . ' <p> &nbsp; </p>' . \PHP_EOL; $str = <<<'EOD' <!-- TRAJET --> <h3>Votre trajet</h2> <div class="septraf"> </div> <p><span style="text-decoration: underline;">Dans les 2 sens</span> :<br />- arrêt Mimosas reporté à l'arrêt provisoire placé route de Vannes au niveau de la station essence<br />- arrêt Cravate reporté à l'arrêt Ferrière</p> <p></p> EOD; $str = preg_replace($pattern, '', $str); echo ($str === $desiredOutput ? 'Matches' : 'Failed') . ' <p></p>' . \PHP_EOL; $str = <<<'EOD' <!-- TRAJET --> <h3>Votre trajet</h2> <div class="septraf"> </div> <p><span style="text-decoration: underline;">Dans les 2 sens</span> :<br />- arrêt Mimosas reporté à l'arrêt provisoire placé route de Vannes au niveau de la station essence<br />- arrêt Cravate reporté à l'arrêt Ferrière</p> <p> </p> EOD; $str = preg_replace($pattern, '', $str); echo ($str === $desiredOutput ? 'Matches' : 'Failed') . ' <p> </p>' . \PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 58
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 73
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
2 jumps found. (Code = 43) Position 1 = 86, Position 2 = 88
Branch analysis from position: 86
1 jumps found. (Code = 42) Position 1 = 89
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 88
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 73
2 jumps found. (Code = 43) Position 1 = 86, Position 2 = 88
Branch analysis from position: 86
Branch analysis from position: 88
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 73
Branch analysis from position: 71
Branch analysis from position: 73
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 58
Branch analysis from position: 56
Branch analysis from position: 58
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
Branch analysis from position: 43
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
Branch analysis from position: 28
filename:       /in/huv0m
function name:  (null)
number of ops:  93
compiled vars:  !0 = $desiredOutput, !1 = $pattern, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%21--+TRAJET+--%3E%0A++%09%3Ch3%3EVotre+trajet%3C%2Fh2%3E%0A++%09%3Cdiv+class%3D%22septraf%22%3E+%3C%2Fdiv%3E%0A++%09%3Cp%3E%3Cspan+style%3D%22text-decoration%3A+underline%3B%22%3EDans+les+2+sens%3C%2Fspan%3E+%3A%3Cbr+%2F%3E-+arr%C3%AAt+Mimosas+report%C3%A9+%C3%A0+l%27arr%C3%AAt+provisoire+plac%C3%A9+route+de+Vannes+au+niveau+de+la+station+essence%3Cbr+%2F%3E-+arr%C3%AAt+Cravate+report%C3%A9+%C3%A0+l%27arr%C3%AAt+Ferri%C3%A8re%3C%2Fp%3E'
   11     1        ASSIGN                                                   !1, '%2F%5Cs%3F%3Cp%3E%28%5Cs%7C%5Cxc2%5Cxa0%7C%26nbsp%3B%29%2A%3C%5C%2Fp%3E%2F'
   13     2        ASSIGN                                                   !2, '%3C%21--+TRAJET+--%3E%0A++%09%3Ch3%3EVotre+trajet%3C%2Fh2%3E%0A++%09%3Cdiv+class%3D%22septraf%22%3E+%3C%2Fdiv%3E%0A++%09%3Cp%3E%3Cspan+style%3D%22text-decoration%3A+underline%3B%22%3EDans+les+2+sens%3C%2Fspan%3E+%3A%3Cbr+%2F%3E-+arr%C3%AAt+Mimosas+report%C3%A9+%C3%A0+l%27arr%C3%AAt+provisoire+plac%C3%A9+route+de+Vannes+au+niveau+de+la+station+essence%3Cbr+%2F%3E-+arr%C3%AAt+Cravate+report%C3%A9+%C3%A0+l%27arr%C3%AAt+Ferri%C3%A8re%3C%2Fp%3E%0A%3Cp%3E+%3C%2Fp%3E'
   21     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 ''
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
   23     9        IS_IDENTICAL                                             !2, !0
         10      > JMPZ                                                     ~8, ->13
         11    >   QM_ASSIGN                                        ~9      'Matches'
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~9      'Failed'
         14    >   CONCAT                                           ~10     ~9, '+%3Cp%3E+%3C%2Fp%3E'
         15        CONCAT                                           ~11     ~10, '%0A'
         16        ECHO                                                     ~11
   25    17        ASSIGN                                                   !2, '%3C%21--+TRAJET+--%3E%0A++%09%3Ch3%3EVotre+trajet%3C%2Fh2%3E%0A++%09%3Cdiv+class%3D%22septraf%22%3E+%3C%2Fdiv%3E%0A++%09%3Cp%3E%3Cspan+style%3D%22text-decoration%3A+underline%3B%22%3EDans+les+2+sens%3C%2Fspan%3E+%3A%3Cbr+%2F%3E-+arr%C3%AAt+Mimosas+report%C3%A9+%C3%A0+l%27arr%C3%AAt+provisoire+plac%C3%A9+route+de+Vannes+au+niveau+de+la+station+essence%3Cbr+%2F%3E-+arr%C3%AAt+Cravate+report%C3%A9+%C3%A0+l%27arr%C3%AAt+Ferri%C3%A8re%3C%2Fp%3E%0A%3Cp%3E%26nbsp%3B%3C%2Fp%3E'
   33    18        INIT_FCALL                                               'preg_replace'
         19        SEND_VAR                                                 !1
         20        SEND_VAL                                                 ''
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $13     
         23        ASSIGN                                                   !2, $13
   34    24        IS_IDENTICAL                                             !2, !0
         25      > JMPZ                                                     ~15, ->28
         26    >   QM_ASSIGN                                        ~16     'Matches'
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~16     'Failed'
         29    >   CONCAT                                           ~17     ~16, '+%3Cp%3E%26nbsp%3B%3C%2Fp%3E'
         30        CONCAT                                           ~18     ~17, '%0A'
         31        ECHO                                                     ~18
   36    32        ASSIGN                                                   !2, '%3C%21--+TRAJET+--%3E%0A++%09%3Ch3%3EVotre+trajet%3C%2Fh2%3E%0A++%09%3Cdiv+class%3D%22septraf%22%3E+%3C%2Fdiv%3E%0A++%09%3Cp%3E%3Cspan+style%3D%22text-decoration%3A+underline%3B%22%3EDans+les+2+sens%3C%2Fspan%3E+%3A%3Cbr+%2F%3E-+arr%C3%AAt+Mimosas+report%C3%A9+%C3%A0+l%27arr%C3%AAt+provisoire+plac%C3%A9+route+de+Vannes+au+niveau+de+la+station+essence%3Cbr+%2F%3E-+arr%C3%AAt+Cravate+report%C3%A9+%C3%A0+l%27arr%C3%AAt+Ferri%C3%A8re%3C%2Fp%3E%0A%3Cp%3E%26nbsp%3B+%3C%2Fp%3E'
   44    33        INIT_FCALL                                               'preg_replace'
         34        SEND_VAR                                                 !1
         35        SEND_VAL                                                 ''
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                         $20     
         38        ASSIGN                                                   !2, $20
   45    39        IS_IDENTICAL                                             !2, !0
         40      > JMPZ                                                     ~22, ->43
         41    >   QM_ASSIGN                                        ~23     'Matches'
         42      > JMP                                                      ->44
         43    >   QM_ASSIGN                                        ~23     'Failed'
         44    >   CONCAT                                           ~24     ~23, '+%3Cp%3E%26nbsp%3B%3C%2Fp%3E'
         45        CONCAT                                           ~25     ~24, '%0A'
         46        ECHO                                                     ~25
   47    47        ASSIGN                                                   !2, '%3C%21--+TRAJET+--%3E%0A++%09%3Ch3%3EVotre+trajet%3C%2Fh2%3E%0A++%09%3Cdiv+class%3D%22septraf%22%3E+%3C%2Fdiv%3E%0A++%09%3Cp%3E%3Cspan+style%3D%22text-decoration%3A+underline%3B%22%3EDans+les+2+sens%3C%2Fspan%3E+%3A%3Cbr+%2F%3E-+arr%C3%AAt+Mimosas+report%C3%A9+%C3%A0+l%27arr%C3%AAt+provisoire+plac%C3%A9+route+de+Vannes+au+niveau+de+la+station+essence%3Cbr+%2F%3E-+arr%C3%AAt+Cravate+report%C3%A9+%C3%A0+l%27arr%C3%AAt+Ferri%C3%A8re%3C%2Fp%3E%0A%3Cp%3E+%26nbsp%3B+%3C%2Fp%3E'
   55    48        INIT_FCALL                                               'preg_replace'
         49        SEND_VAR                                                 !1
         50        SEND_VAL                                                 ''
         51        SEND_VAR                                                 !2
         52        DO_ICALL                                         $27     
         53        ASSIGN                                                   !2, $27
   56    54        IS_IDENTICAL                                             !2, !0
         55      > JMPZ                                                     ~29, ->58
         56    >   QM_ASSIGN                                        ~30     'Matches'
         57      > JMP                                                      ->59
         58    >   QM_ASSIGN                                        ~30     'Failed'
         59    >   CONCAT                                           ~31     ~30, '+%3Cp%3E+%26nbsp%3B+%3C%2Fp%3E'
         60        CONCAT                                           ~32     ~31, '%0A'
         61        ECHO                                                     ~32
   59    62        ASSIGN                                                   !2, '%3C%21--+TRAJET+--%3E%0A++%09%3Ch3%3EVotre+trajet%3C%2Fh2%3E%0A++%09%3Cdiv+class%3D%22septraf%22%3E+%3C%2Fdiv%3E%0A++%09%3Cp%3E%3Cspan+style%3D%22text-decoration%3A+underline%3B%22%3EDans+les+2+sens%3C%2Fspan%3E+%3A%3Cbr+%2F%3E-+arr%C3%AAt+Mimosas+report%C3%A9+%C3%A0+l%27arr%C3%AAt+provisoire+plac%C3%A9+route+de+Vannes+au+niveau+de+la+station+essence%3Cbr+%2F%3E-+arr%C3%AAt+Cravate+report%C3%A9+%C3%A0+l%27arr%C3%AAt+Ferri%C3%A8re%3C%2Fp%3E%0A%3Cp%3E%3C%2Fp%3E'
   67    63        INIT_FCALL                                               'preg_replace'
         64        SEND_VAR                                                 !1
         65        SEND_VAL                                                 ''
         66        SEND_VAR                                                 !2
         67        DO_ICALL                                         $34     
         68        ASSIGN                                                   !2, $34
   68    69        IS_IDENTICAL                                             !2, !0
         70      > JMPZ                                                     ~36, ->73
         71    >   QM_ASSIGN                                        ~37     'Matches'
         72      > JMP                                                      ->74
         73    >   QM_ASSIGN                                        ~37     'Failed'
         74    >   CONCAT                                           ~38     ~37, '+%3Cp%3E%3C%2Fp%3E'
         75        CONCAT                                           ~39     ~38, '%0A'
         76        ECHO                                                     ~39
   70    77        ASSIGN                                                   !2, '%3C%21--+TRAJET+--%3E%0A++%09%3Ch3%3EVotre+trajet%3C%2Fh2%3E%0A++%09%3Cdiv+class%3D%22septraf%22%3E+%3C%2Fdiv%3E%0A++%09%3Cp%3E%3Cspan+style%3D%22text-decoration%3A+underline%3B%22%3EDans+les+2+sens%3C%2Fspan%3E+%3A%3Cbr+%2F%3E-+arr%C3%AAt+Mimosas+report%C3%A9+%C3%A0+l%27arr%C3%AAt+provisoire+plac%C3%A9+route+de+Vannes+au+niveau+de+la+station+essence%3Cbr+%2F%3E-+arr%C3%AAt+Cravate+report%C3%A9+%C3%A0+l%27arr%C3%AAt+Ferri%C3%A8re%3C%2Fp%3E%0A%3Cp%3E%C2%A0%3C%2Fp%3E'
   78    78        INIT_FCALL                                               'preg_replace'
         79        SEND_VAR                                                 !1
         80        SEND_VAL                                                 ''
         81        SEND_VAR                                                 !2
         82        DO_ICALL                                         $41     
         83        ASSIGN                                                   !2, $41
   79    84        IS_IDENTICAL                                             !2, !0
         85      > JMPZ                                                     ~43, ->88
         86    >   QM_ASSIGN                                        ~44     'Matches'
         87      > JMP                                                      ->89
         88    >   QM_ASSIGN                                        ~44     'Failed'
         89    >   CONCAT                                           ~45     ~44, '+%3Cp%3E%C2%A0%3C%2Fp%3E'
         90        CONCAT                                           ~46     ~45, '%0A'
         91        ECHO                                                     ~46
   80    92      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.32 ms | 1023 KiB | 14 Q