<?php
class Classe {
public $exemplo = [];
public function add($parametro1, $parametro2){
$this->exemplo['parametro1'] = $parametro1;
$this->exemplo['parametro2'] = $parametro2;
}
}
$classe = new Classe;
$classe->add('parâmetro 1 aqui', function(){
return 'retorno da função anonima para o parâmetro 2';
});
echo $classe->exemplo['parametro2']();
PD9waHAKY2xhc3MgQ2xhc3NlIHsKICAgIHB1YmxpYyAkZXhlbXBsbyA9IFtdOwogICAgcHVibGljIGZ1bmN0aW9uIGFkZCgkcGFyYW1ldHJvMSwgJHBhcmFtZXRybzIpewogICAgICAgICR0aGlzLT5leGVtcGxvWydwYXJhbWV0cm8xJ10gPSAkcGFyYW1ldHJvMTsKICAgICAgICAkdGhpcy0+ZXhlbXBsb1sncGFyYW1ldHJvMiddID0gJHBhcmFtZXRybzI7CiAgICB9Cn0KJGNsYXNzZSA9IG5ldyBDbGFzc2U7CiRjbGFzc2UtPmFkZCgncGFyw6JtZXRybyAxIGFxdWknLCBmdW5jdGlvbigpewogICAgcmV0dXJuICdyZXRvcm5vIGRhIGZ1bsOnw6NvIGFub25pbWEgcGFyYSBvIHBhcsOibWV0cm8gMic7Cn0pOwplY2hvICRjbGFzc2UtPmV4ZW1wbG9bJ3BhcmFtZXRybzInXSgpOw==