-
-
Save jazzdan/0dcb850e6b2f59cdedbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?hh // strict | |
class Caller { | |
public function set(string $property_name, Foo $object): void { | |
$object->$property_name = 'poopy'; | |
} | |
public function call(string $property_name, Foo $object): string { | |
return $object->$property_name; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?hh // strict | |
class Foo { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'foo.hh'; | |
require 'caller.hh'; | |
$caller = new Caller(); | |
$foo = new Foo(); | |
$caller->set('poo', $foo); | |
echo $caller->call('poo', $foo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ hh_client . | |
/home/vagrant/dynamic_properties/caller.hh:5:14,27: Dynamic method call (Naming[2011]) | |
/home/vagrant/dynamic_properties/caller.hh:8:20,33: Dynamic method call (Naming[2011]) | |
$ hhvm main.php | |
poopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment