3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Mislukte opvragingen: Limburger, De Gelderlander, RTV Noord, Rijnmond, RTV Utrecht, De Telegraaf, Nieuws.nl, Verkeersnet, Leidsch Dagblad, NS Pers, NS Actueel"; function shortenString($string) { if(strlen($string) > 30) { echo substr($string, 0, 30 ) . '...'; } else { echo $string; } } ?><!DOCTYPE html> <html> <head> <title>Test</title> <meta charset="ISO-8859-1"> </head> <body> <?php echo ' <table border="0" width="55%" cellspacing="0" cellpadding="0"> <tr> <th>ID</th> <th>Filename</th> <th>Date Logged</th> <th>Parsetime</th> <th>Comments</th> </tr> <tr> <td>6</td> <td>newsscanner.php</td> <td>1 feb 2017 om: 11:21</td> <td>11.9235889</td> <td>'.shortenString($string).'</td> </tr> </table>'; ?> </body> </html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rBbXS
function name:  (null)
number of ops:  10
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Mislukte+opvragingen%3A+Limburger%2C+De+Gelderlander%2C+RTV+Noord%2C+Rijnmond%2C+RTV+Utrecht%2C+De+Telegraaf%2C+Nieuws.nl%2C+Verkeersnet%2C+Leidsch+Dagblad%2C+NS+Pers%2C+NS+Actueel'
   11     1        ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A++++%3Chead%3E%0A%09%3Ctitle%3ETest%3C%2Ftitle%3E%0A%09%3Cmeta+charset%3D%22ISO-8859-1%22%3E%0A++++%3C%2Fhead%3E%0A++++%3Cbody%3E%0A'
   33     2        INIT_FCALL                                               'shortenstring'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        CONCAT                                           ~3      '%0A%09%3Ctable+border%3D%220%22+width%3D%2255%25%22+cellspacing%3D%220%22+cellpadding%3D%220%22%3E%0A%09++++%3Ctr%3E%0A%09%09++++%3Cth%3EID%3C%2Fth%3E%0A%09%09++++%3Cth%3EFilename%3C%2Fth%3E%0A%09%09++++%3Cth%3EDate+Logged%3C%2Fth%3E%0A%09%09++++%3Cth%3EParsetime%3C%2Fth%3E%0A%09%09++++%3Cth%3EComments%3C%2Fth%3E%0A%09++++%3C%2Ftr%3E%0A%09++++%3Ctr%3E%0A%09%09++++%3Ctd%3E6%3C%2Ftd%3E%0A%09%09++++%3Ctd%3Enewsscanner.php%3C%2Ftd%3E%0A%09%09++++%3Ctd%3E1+feb+2017+om%3A+11%3A21%3C%2Ftd%3E%0A%09%09++++%3Ctd%3E11.9235889%3C%2Ftd%3E%0A%09%09++++%3Ctd%3E', $2
          6        CONCAT                                           ~4      ~3, '%3C%2Ftd%3E%0A%09++++%3C%2Ftr%3E%0A%09%3C%2Ftable%3E'
          7        ECHO                                                     ~4
   37     8        ECHO                                                     '++++%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   38     9      > RETURN                                                   1

Function shortenstring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rBbXS
function name:  shortenString
number of ops:  14
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        STRLEN                                           ~1      !0
          2        IS_SMALLER                                               30, ~1
          3      > JMPZ                                                     ~2, ->12
    6     4    >   INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 30
          8        DO_ICALL                                         $3      
          9        CONCAT                                           ~4      $3, '...'
         10        ECHO                                                     ~4
         11      > JMP                                                      ->13
    8    12    >   ECHO                                                     !0
   10    13    > > RETURN                                                   null

End of function shortenstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.64 ms | 1399 KiB | 16 Q