<?php class O { public $string = 'string'; public $int = 0; public $float = 1.0; function method($name) { return $this->$name; } } $o = new O; $switch = 'string'; switch ($switch) { case $o->string: case $o->int: case $o->float: echo "accept\n"; break; } switch ($switch) { case $o->method('string'): case $o->method('int'): case $o->method('float'): echo "accept\n"; break; }
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`