3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<'TEXT' <?php /** * Name: Offerte bekijken * * @var \Cake\View\View $this * @var \App\Model\Entity\Quote $quote Quote to show * @var \App\Model\Entity\QuoteType $chosenQuoteType Chosen Quote Type * @var \App\Model\Entity\QuoteCalculationsPackage $chosenQuotePackage Chosen Quote Package * @var string $chosenQuoteTemplate Template (rent, buy, a1k, a1h) */ use App\Controller\Calculator\SavingsA1H; use Cake\Chronos\Chronos; /* * Variables to load: * * $quote->package->name * $chosenQuotePackage->package->name * $chosenQuotePackage->package->panel->wp * $quote->package->panel->wp * $chosenQuotePackage->inverter->inverter_type->name * $chosenQuotePackage->inverter->brand->name */ $quote_type_id = $quote->quote_type_id; $this->assign( 'title', 'Uw persoonlijke offerte van Zelfstroom' ); if ( empty( $extraCalculations ) ) { $extraCalculations = []; } ?> <?= $this->Cell( 'Header', [ $quote, $chosenQuoteType ] ); ?> <?php if ( ! isset( $isPdf ) || ! $isPdf ): echo $this->Cell( 'PingPong', [ $quote->id ] ); endif; ?> <?= $this->Html->script( [ "https://code.jquery.com/ui/1.11.4/jquery-ui.min.js", "bootstrap/bootstrap.min.js", "Bootgrid.moment-with-locales.min.js", "datepicker-nl.js", "jquery.datetimepicker.full.min.js", "jquery.validate.min.js", ], [ 'block' => 'scriptBottom' ] ); ?> <?= $this->Html->css( [ 'bootstrap/bootstrap.css', 'appointment_calendar.css', "jquery.datetimepicker.min.css", ] ); ?> <?= $this->fetch( 'css' ) ?> <?= $this->fetch( 'script' ) ?> <main class="site-content"> <div class="container"> <section class="section section--white section--intro"> <div class="row"> <div class="col-xs-12 col-sm-10 col-sm-offset-1 center"> <header> <h1><?= sprintf( __( 'Personal quote for %s' ), $quote->quote_request->contact->fullname ); ?></h1> </header> <figure class="small cover-image"> <?= $this->Html->image( '/' . $quote->image_street, [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <div class="body"> <p><?= $quote->custom_text_intro; ?></p> <footer> <span><?= __( 'Your Zelfstroom advisor' ); ?></span> <span class="advisor"><?= $quote->sales_advisor->fullname; ?></span> </footer> </div> </div> </div> </section> <?php $cellSectionSavings = $this->Cell( 'FrontendSectionSavings', [ $quote, $chosenQuotePackage, $extraCalculations, $chosenQuoteType ] ); $cellSectionSavings->template = $chosenQuoteTemplate; $cellSectionPackage = $this->Cell( 'FrontendSectionPackage', [ $quote, $chosenQuotePackage, $extraCalculations, $chosenQuoteType ] ); $cellSectionPackage->template = $chosenQuoteTemplate; $cellSectionGuarantees = $this->Cell( 'FrontendSectionGuarantees', [ $quote, $chosenQuotePackage, $extraCalculations, $chosenQuoteType ] ); $cellSectionGuarantees->template = $chosenQuoteTemplate; $cellSectionNewPlan = $this->Cell( 'FrontendSectionNewPlan', [ $quote, $chosenQuotePackage, $extraCalculations, $chosenQuoteType ] ); $cellSectionNewPlan->template = $chosenQuoteTemplate; echo $cellSectionSavings; echo $cellSectionPackage; echo $cellSectionGuarantees; echo $cellSectionNewPlan; ?> <?php if ( $chosenQuoteTemplate == 'rent' || $chosenQuoteTemplate == 'a1h' ) { ?> <section class="section section--orange-light section--process"> <div class="row"> <div class="col-xs-12 col-sm-10 col-sm-offset-1 center"> <header> <h2><?= __( 'How to continue' ); ?></h2> </header> <div class="row cta cta--dots"> <div class="col-sm-6 col-md-2 col-sm-offset-0 col-md-offset-1 cta__item__rent"> <figure> <?= $this->Html->image( '/frontend/dist/images/icon-search.svg', [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <header> <h4 data-edit="true" data-type="wysiwyg" data-name="Beoordeling">We beoordelen uw aanvraag en berichten u over de acceptatie daarvan.</h4> </header> </div> <div class="col-sm-6 col-md-2 cta__item__rent"> <figure> <?= $this->Html->image( '/frontend/dist/images/icon-phone-dial.svg', [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <header> <h4 data-type="text" data-edit="true" data-name="Bellen">We bellen u voor een afspraak.</h4> </header> </div> <div class="col-sm-6 col-md-2 cta__item__rent"> <figure> <?= $this->Html->image( '/frontend/dist/images/icon-technical.svg', [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <header> <h4 data-edit="true" data-type="text" data-name="Technisch specialist">Technisch specialist neemt <strong>bij u</strong> alles nog even door.</h4> </header> </div> <div class="col-sm-6 col-md-2 cta__item__rent"> <figure> <?= $this->Html->image( '/frontend/dist/images/icon-house.svg', [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <header> <h4>Installatie van de panelen in 1 dag.</h4> </header> </div> <div class="col-sm-6 col-md-2 cta__item__rent"> <figure> <?= $this->Html->image( '/frontend/dist/images/icon-bolt.svg', [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <header> <h4>Over enkele weken maakt u zelf stroom</h4> </header> </div> </div> </div> </div> </section> <?php } else { ?> <section class="section section--orange-light section--process"> <div class="row"> <div class="col-xs-12 col-sm-10 col-sm-offset-1 center"> <header> <h2><?= __( 'How to continue' ); ?></h2> </header> <div class="row cta cta--dots"> <div class="col-xs-6 col-sm-3 cta__item"> <figure> <?= $this->Html->image( '/frontend/dist/images/icon-phone-dial.svg', [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <header> <h4>We bellen u voor een afspraak.</h4> </header> </div> <div class="col-xs-6 col-sm-3 cta__item"> <figure> <?= $this->Html->image( '/frontend/dist/images/icon-technical.svg', [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <header> <h4>Technisch specialist neemt bij u alles nog even door.</h4> </header> </div> <div class="col-xs-6 col-sm-3 cta__item"> <figure> <?= $this->Html->image( '/frontend/dist/images/icon-house.svg', [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <header> <h4>Installatie van de panelen in 1 dag.</h4> </header> </div> <div class="col-xs-6 col-sm-3 cta__item"> <figure> <?= $this->Html->image( '/frontend/dist/images/icon-bolt.svg', [ 'alt' => __( '' ), 'fullBase' => true ] ) ?> </figure> <header> <h4>Over enkele weken maakt u zelf stroom</h4> </header> </div> </div> </div> </div> </section> <?php } ?> <?php if ( ! isset( $isPdf ) ): $this->Cell( 'Reviews' ); endif; ?> </div> <?php if ( isset( $isPdf ) ): ?> <div class="pdfpagebreak"></div> <?php $confirmTemplate = 'koop'; if ( $chosenQuoteTemplate == 'rent' || $chosenQuoteTemplate == 'a1h' ) { $confirmTemplate = 'huur'; } $cellSectionConfirm = $this->Cell( 'Confirm', [ $quote, $chosenQuotePackage, $chosenQuoteType, $chosenQuoteTemplate, $termsOfConditions ] ); echo $cellSectionConfirm->render( 'confirm_' . $confirmTemplate ); endif; ?> </main> <?php if ( ! isset( $isPdf ) ): echo $this->Cell( 'Footer' ); endif; ?> <!-- Appointments modal --> <div class="modal fade" id="appointmentModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="myModalLabel"> <?= __( "Let's make an appointment" ); ?> </h4> </div> <div class="modal-body"> <div class="appointmentPicker"> <div id="JQueryAppointmentCalendar_1" class="JQueryAppointmentCalendar"></div> <div class="appointmentLoader"></div> <div id="JQueryAppointmentTimes_1" class="JQueryAppointmentTimes"> <div class="messages"></div> <div class="times"></div> </div> <div id="JQueryAppointmentSummary_1" class="JQueryAppointmentSummary"> <div class="messages"></div> </div> <div id="JQueryAppointmentFinished_1" class="JQueryAppointmentFinished"> <div class="messages"> </div> </div> </div> </div> <div class="modal-footer"> <button type="button" class="button appointment--close" data-dismiss="modal"> <span><?= __( 'Not now' ); ?></span> </button> <button type="button" class="button button--blue button--icon appointment--make"> <span><?= __( "Make appointment" ); ?></span> </button> </div> </div> </div> </div> <script> ... </script> TEXT; $dom=new DOMDocument; libxml_use_internal_errors(true); // for malformed html warning suppression $dom->loadHTML($text, LIBXML_NOENT); //libxml_clear_errors(); // for warning suppression $xpath = new DOMXPath($dom); foreach ($xpath->query("//*[@data-edit='true' and @data-type and @data-name]") as $node) { $results[] = [ 'type' => $node->getAttribute('data-type'), 'name' => $node->getAttribute('data-name'), 'text' => $node->textContent ]; } var_export($results);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.140.0130.01317.88
8.4.130.0120.00919.28
8.4.120.0110.01024.39
8.4.110.0120.01019.61
8.4.100.0030.00619.27
8.4.90.0040.00522.98
8.4.80.0060.00320.84
8.4.70.0090.00718.57
8.4.60.0070.00320.85
8.4.50.0120.00918.53
8.4.40.0170.00319.88
8.4.30.0170.00319.95
8.4.20.0180.00420.91
8.4.10.0120.00619.94
8.3.270.0140.00617.07
8.3.260.0120.00817.48
8.3.250.0090.01019.48
8.3.240.0110.00817.59
8.3.230.0120.00917.41
8.3.220.0060.00419.57
8.3.210.0120.00917.25
8.3.200.0040.00617.14
8.3.190.0100.01017.50
8.3.180.0090.00717.15
8.3.170.0190.00017.66
8.3.160.0100.01017.23
8.3.150.0130.00718.75
8.3.140.0050.00317.63
8.3.130.0060.00317.15
8.3.120.0070.01321.32
8.3.110.0060.00320.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0050.00917.97
8.3.70.0130.01018.65
8.3.60.0090.00618.92
8.3.50.0090.01118.73
8.3.40.0110.00819.45
8.3.30.0100.00719.34
8.3.20.0090.00019.46
8.3.10.0080.00024.08
8.3.00.0040.00421.24
8.2.290.0110.00921.02
8.2.280.0030.00521.06
8.2.270.0130.00617.48
8.2.260.0060.01317.02
8.2.250.0080.00017.04
8.2.240.0110.00817.84
8.2.230.0040.00422.58
8.2.220.0030.00737.54
8.2.210.0000.00826.77
8.2.200.0060.00617.38
8.2.190.0160.00016.94
8.2.180.0040.01919.04
8.2.170.0040.01122.96
8.2.160.0100.00322.64
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0030.00518.59
8.2.120.0080.00026.35
8.2.110.0030.00722.61
8.2.100.0100.00318.28
8.2.90.0060.00319.70
8.2.80.0040.00417.97
8.2.70.0000.00918.25
8.2.60.0040.00418.10
8.2.50.0050.00318.00
8.2.40.0040.00419.80
8.2.30.0030.00619.82
8.2.20.0060.00318.50
8.2.10.0040.00418.67
8.2.00.0000.00818.56
8.1.330.0040.00522.80
8.1.320.0130.00716.84
8.1.310.0030.00619.09
8.1.300.0060.00320.64
8.1.290.0030.01030.84
8.1.280.0070.01625.92
8.1.270.0040.00422.64
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0070.00321.46
8.1.230.0000.01218.27
8.1.220.0030.00618.04
8.1.210.0030.00618.77
8.1.200.0030.00617.98
8.1.190.0060.00617.50
8.1.180.0080.00418.10
8.1.170.0080.00319.04
8.1.160.0000.00819.39
8.1.150.0040.00419.28
8.1.140.0000.00822.73
8.1.130.0050.00220.64
8.1.120.0040.00417.95
8.1.110.0050.00317.96
8.1.100.0080.00018.00
8.1.90.0030.00617.91
8.1.80.0030.00617.96
8.1.70.0000.00718.01
8.1.60.0060.00318.09
8.1.50.0040.00417.91
8.1.40.0060.00317.94
8.1.30.0060.00317.98
8.1.20.0000.00818.11
8.1.10.0050.00318.07
8.1.00.0060.00318.02
8.0.300.0050.00318.77
8.0.290.0000.01017.25
8.0.280.0070.00019.03
8.0.270.0080.00017.37
8.0.260.0000.00718.95
8.0.250.0070.00317.43
8.0.240.0070.00017.52
8.0.230.0030.00917.53
8.0.220.0090.00617.39
8.0.210.0040.00417.49
8.0.200.0030.00517.55
8.0.190.0040.00417.53
8.0.180.0030.00617.39
8.0.170.0060.00317.43
8.0.160.0030.00517.46
8.0.150.0070.00417.43
8.0.140.0080.00017.34
8.0.130.0030.00613.98
8.0.120.0030.00617.41
8.0.110.0060.00317.39
8.0.100.0080.00017.30
8.0.90.0030.00517.36
8.0.80.0060.00917.41
8.0.70.0080.00017.50
8.0.60.0050.00317.38
8.0.50.0060.00317.48
8.0.30.0120.01017.60
8.0.20.0140.00617.53
8.0.10.0080.00017.60
8.0.00.0170.00517.16
7.4.330.0000.00515.55
7.4.320.0000.00717.15
7.4.300.0000.00717.13
7.4.290.0030.00517.00
7.4.280.0040.00417.15
7.4.270.0040.00416.95
7.4.260.0080.00016.94
7.4.250.0000.00816.92
7.4.240.0040.00417.05
7.4.230.0080.00017.11
7.4.220.0040.00417.21
7.4.210.0090.01117.02
7.4.200.0030.00516.87
7.4.160.0090.00816.96
7.4.140.0100.01017.86
7.4.130.0140.00316.82
7.4.120.0120.00917.08
7.4.110.0130.00717.24
7.4.100.0130.01117.04
7.4.90.0160.01016.85
7.4.80.0090.00919.39
7.4.70.0170.00017.13
7.4.60.0170.00016.93
7.4.50.0060.01117.13
7.4.40.0060.01217.19
7.4.00.0070.01115.46
7.3.330.0030.00313.67
7.3.320.0000.00713.65
7.3.310.0030.00616.91
7.3.300.0040.00416.76
7.3.290.0030.00716.72
7.3.280.0070.00816.68
7.3.260.0090.01016.85
7.3.240.0170.00416.89
7.3.230.0140.00516.83
7.3.210.0060.01216.95
7.3.200.0030.02016.91
7.3.190.0090.01016.70
7.3.180.0070.01116.71
7.3.170.0190.00317.00
7.3.160.0100.01016.83
7.3.10.0140.01116.41
7.3.00.0150.01216.60
7.2.330.0120.00616.94
7.2.320.0110.01117.07
7.2.310.0000.01817.07
7.2.300.0150.00917.18
7.2.290.0130.01016.95
7.2.130.0070.01116.68
7.2.120.0100.00816.68
7.2.110.0110.00616.65
7.2.100.0070.00916.71
7.2.90.0100.00616.84
7.2.80.0120.00816.71
7.2.70.0050.01016.83
7.2.60.0080.01017.07
7.2.50.0060.01016.90
7.2.40.0110.00916.83
7.2.30.0120.00716.82
7.2.20.0110.00516.94
7.2.10.0100.00716.89
7.2.00.0110.01117.06
7.1.250.0120.00315.48
7.1.240.0030.00915.75
7.1.230.0000.01216.05
7.1.220.0080.00516.06
7.1.210.0040.01116.03
7.1.200.0080.00615.78
7.1.190.0030.01316.02
7.1.180.0040.01116.04
7.1.170.0090.00416.06
7.1.160.0110.00715.93
7.1.150.0110.00616.03
7.1.140.0040.01316.10
7.1.130.0070.01015.84
7.1.120.0130.00316.10
7.1.110.0100.00316.09
7.1.100.0070.00416.06
7.1.90.0080.00815.93
7.1.80.0000.01215.90
7.1.70.0070.00715.77
7.1.60.0090.00415.84
7.1.50.0060.00915.99
7.1.40.0060.00916.01
7.1.30.0060.00915.70
7.1.20.0050.00815.97
7.1.10.0130.00015.61
7.1.00.0120.00815.79
5.6.380.0030.01014.41

preferences:
31.69 ms | 403 KiB | 5 Q