3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace ElasticSearch { class Thing { public function tmp (){ echo 'ElasticSearch';} } } namespace Elasticsearch { class Thing { public function tmp (){ echo 'Elasticsearch';} } class Builder { public function thing() { return new Thing; } } } namespace { $class = new ElasticSearch\Thing; $builder = new Elasticsearch\Builder; echo $builder->thing->tmp(); }
Output for 7.0.0 - 7.0.11
Fatal error: Cannot declare class Elasticsearch\Thing, because the name is already in use in /in/mn9jq on line 10
Process exited with code 255.
Output for 5.6.0 - 5.6.26
Fatal error: Cannot redeclare class Elasticsearch\Thing in /in/mn9jq on line 10
Process exited with code 255.