{"action":"created","issue":{"url":"https://api.github.com/repos/Corveda/PHPSandbox/issues/3","repository_url":"https://api.github.com/repos/Corveda/PHPSandbox","labels_url":"https://api.github.com/repos/Corveda/PHPSandbox/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Corveda/PHPSandbox/issues/3/comments","events_url":"https://api.github.com/repos/Corveda/PHPSandbox/issues/3/events","html_url":"https://github.com/Corveda/PHPSandbox/issues/3","id":155403283,"number":3,"title":"How to redefine a internal function","user":{"login":"forfrt","id":2369749,"avatar_url":"https://avatars.githubusercontent.com/u/2369749?v=3","gravatar_id":"","url":"https://api.github.com/users/forfrt","html_url":"https://github.com/forfrt","followers_url":"https://api.github.com/users/forfrt/followers","following_url":"https://api.github.com/users/forfrt/following{/other_user}","gists_url":"https://api.github.com/users/forfrt/gists{/gist_id}","starred_url":"https://api.github.com/users/forfrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forfrt/subscriptions","organizations_url":"https://api.github.com/users/forfrt/orgs","repos_url":"https://api.github.com/users/forfrt/repos","events_url":"https://api.github.com/users/forfrt/events{/privacy}","received_events_url":"https://api.github.com/users/forfrt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-18T02:23:04Z","updated_at":"2016-05-18T07:05:07Z","closed_at":"2016-05-18T04:18:08Z","body":"It says in the introduction that:\r\n\r\n> Can redefine internal PHP and other functions to make them more secure for sandbox usage.\r\n\r\nSo I have tried using defineFunc like below:\r\n\r\n             $newSandbox=$this->sandbox->defineFunc(\"phpinfo\", function(){\r\n                 echo \"hellow phpinfo\";\r\n             });\r\n             $newSandbox->whitelistFunc('phpinfo');\r\n             #printHello('1\\n');\r\n             $newSandbox->execute(function(){\r\n                 phpinfo();\r\n             });\r\n\r\nBut it seems doesn't work fine with `eval` statement. Furthermore, Could I have any method to inherit internal function other than totally rewrite it.\r\n\r\nBest regrads."},"comment":{"url":"https://api.github.com/repos/Corveda/PHPSandbox/issues/comments/219942824","html_url":"https://github.com/Corveda/PHPSandbox/issues/3#issuecomment-219942824","issue_url":"https://api.github.com/repos/Corveda/PHPSandbox/issues/3","id":219942824,"user":{"login":"forfrt","id":2369749,"avatar_url":"https://avatars.githubusercontent.com/u/2369749?v=3","gravatar_id":"","url":"https://api.github.com/users/forfrt","html_url":"https://github.com/forfrt","followers_url":"https://api.github.com/users/forfrt/followers","following_url":"https://api.github.com/users/forfrt/following{/other_user}","gists_url":"https://api.github.com/users/forfrt/gists{/gist_id}","starred_url":"https://api.github.com/users/forfrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forfrt/subscriptions","organizations_url":"https://api.github.com/users/forfrt/orgs","repos_url":"https://api.github.com/users/forfrt/repos","events_url":"https://api.github.com/users/forfrt/events{/privacy}","received_events_url":"https://api.github.com/users/forfrt/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T07:05:07Z","updated_at":"2016-05-18T07:05:07Z","body":"I got it.\r\nAnother question is, How to rewrite the internal statement `eval`. I would like to log every arguments before `eval` statement is executed. I know it is a language construct, but still cant find a way to rewrite it."}}