Skip to content

Instantly share code, notes, and snippets.

@juniorz
Created July 15, 2010 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juniorz/477461 to your computer and use it in GitHub Desktop.
Save juniorz/477461 to your computer and use it in GitHub Desktop.
<?php
/*
incluo a classe que eu vou usar, confiando que no "ambiente" $dir_raiz vai me dar o diretorio raiz em relação a aplicação rodando.
*/
include($dir_raiz.'/classes/pai.php');
class Filha extends Pai
{
public $var1 = 'SimSimSim';
}
?>
<?php
//Defino o diretorio raiz
$dir_raiz = realpath('.');
//A classe que eu vou usar
include($dir_raiz.'/classes/filha.php');
$obj = new Filha();
?>
<pre>
<?=print_f($obj);?>
</pre>
<?php
class Pai
{
public $var2 = 'NaonaoNao';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment