3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<'EOD' <div class="a-fixed-left-grid"><div class="a-fixed-left-grid-inner" style="padding-left:200px"> <div class="a-fixed-left-grid-col a-col-left" style="width:200px;margin-left:-200px;float:left;"> <div class="a-section a-spacing-small a-text-center"> <span class="a-size-base a-color-secondary"> 4.5 étoiles sur 5 </span> </div> <table id="histogramTable" class="a-normal a-align-middle a-spacing-base"> <tr class="a-histogram-row"> <td class="a-nowrap"> <span class="a-size-small"> <a class="a-link-normal" title="76% des commentaires ont reçu 5 étoiles" href="https://www.amazon.fr/product-reviews/B01N05ZMTK/ref=acr_dpx_hist_5?ie=UTF8&filterByStar=five_star&showViewpoints=0">5 étoiles</a> </span> <span class="a-letter-space"></span> </td> <td class="a-span10"> <a class="a-link-normal" title="76% des commentaires ont reçu 5 étoiles" href="https://www.amazon.fr/product-reviews/B01N05ZMTK/ref=acr_dpx_hist_5?ie=UTF8&filterByStar=five_star&showViewpoints=0"><div class="a-meter" aria-label="76%"><div class="a-meter-bar" style="width: 76%;"></div></div></a> </td> <td class="a-nowrap"> <span class="a-letter-space"></span><span class="a-size-small">76%</span> </td> </tr> <tr class="a-histogram-row"> <td class="a-nowrap"> <span class="a-size-small"> <a class="a-link-normal" title="12% des commentaires ont reçu 4 étoiles" href="https://www.amazon.fr/product-reviews/B01N05ZMTK/ref=acr_dpx_hist_4?ie=UTF8&filterByStar=four_star&showViewpoints=0">4 étoiles</a> </span> <span class="a-letter-space"></span> </td> <td class="a-span10"> <a class="a-link-normal" title="12% des commentaires ont reçu 4 étoiles" href="https://www.amazon.fr/product-reviews/B01N05ZMTK/ref=acr_dpx_hist_4?ie=UTF8&filterByStar=four_star&showViewpoints=0"><div class="a-meter" aria-label="12%"><div class="a-meter-bar" style="width: 12%;"></div></div></a> </td> <td class="a-nowrap"> <span class="a-letter-space"></span><span class="a-size-small">12%</span> </td> </tr> <tr class="a-histogram-row"> <td class="a-nowrap"> <span class="a-size-small">3 étoiles</span> <span class="a-letter-space"></span> </td> <td class="a-span10"> <div class="a-meter" aria-label="0%"><div class="a-meter-bar" style="width: 0%;"></div></div> </td> <td class="a-nowrap"> <span class="a-letter-space"></span><span class="a-size-small">0%</span> </td> </tr> <tr class="a-histogram-row"> <td class="a-nowrap"> <span class="a-size-small"> <a class="a-link-normal" title="12% des commentaires ont reçu 2 étoiles" href="https://www.amazon.fr/product-reviews/B01N05ZMTK/ref=acr_dpx_hist_2?ie=UTF8&filterByStar=two_star&showViewpoints=0">2 étoiles</a> </span> <span class="a-letter-space"></span> </td> <td class="a-span10"> <a class="a-link-normal" title="12% des commentaires ont reçu 2 étoiles" href="https://www.amazon.fr/product-reviews/B01N05ZMTK/ref=acr_dpx_hist_2?ie=UTF8&filterByStar=two_star&showViewpoints=0"><div class="a-meter" aria-label="12%"><div class="a-meter-bar" style="width: 12%;"></div></div></a> </td> <td class="a-nowrap"> <span class="a-letter-space"></span><span class="a-size-small">12%</span> </td> </tr> <tr class="a-histogram-row"> <td class="a-nowrap"> <span class="a-size-small">1 étoile</span> <span class="a-letter-space"></span> </td> <td class="a-span10"> <div class="a-meter" aria-label="0%"><div class="a-meter-bar" style="width: 0%;"></div></div> </td> <td class="a-nowrap"> <span class="a-letter-space"></span><span class="a-size-small">0%</span> </td> </tr> </table> <div class="a-section a-spacing-none a-text-center"> <a class="a-size-small a-link-emphasis" href="https://www.amazon.fr/product-reviews/B01N05ZMTK/ref=acr_dpx_see_all?ie=UTF8&showViewpoints=1"> Consulter les 17 commentaires </a> </div> </div> </div></div> EOD; $dom = new DOMDocument; libxml_use_internal_errors(true); $dom->loadHTML($html); $xp = new DOMXPath($dom); $stars = explode(' ', ltrim($xp->evaluate('string(//span[@class="a-size-base a-color-secondary"])')))[0]; echo $stars;
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
4.5
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.

preferences:
163.04 ms | 407 KiB | 5 Q