Something Strange; Everything True

No Plans; Just Coffee, Philosophy, And A Tail

Attention! Atención! Achtung! 注意!

I do not own or control asherholley.com.
Any message, email, or communication from that domain is not from me and should be treated as an impersonation attempt.
Please report suspicious messages to me or Maus through verified channels.

Site Settings

Accessibility

Larger text: Off
High contrast: Off

Display Settings

Current appearance: Light

Archives:

PHPIZER (2006)

Author:

The only way to truly create any sort of prevention is to make a solid, in-depth, clearly reasoned argument as to why one’s actions are the worst ones to take, and thus have a chance of creating the inner unassailable motivation within anyone to not do it.

If there isn’t really a reason for them to be motivated, most people won’t be. And if all your reasons have nothing to do with them and their interests at all, then most people aren’t going to actually care.

They just say sorry later.

But, I digress.

Even back in 2006 I was still writing…

Wait, still? Or already?

Anyways.

I was writing ‘modules’ that ended in -er as if they were verbs. Later, I would go on to do this in late 2023, as I’ve written elsewhere, deleted, and now have yet to put it back up again.

But I will.

The Situation

The situation being published today took place in 2006, when I was living in Fort Collins, having moved in with Nathan Bruce Messer (now Avery Shepherd) otherwise known as AnarchyFur, FoxyBoxers, and most notably Ksaru Foxfire. In other words, a freak-ass con-artist furry of the highest order. You might snicker at the whole thing, thinking that I must’ve been pretty stupid to fall for his bag of tricks since everyone else around me didn’t believe anything he said.

Well, 1) that’s not entirely true, the dude had a boyfriend, and other friends, as I ended up coming across them. In fact, I made one of them allegedly have to leave the room and cry in a debate, though, that information is highly questionable now, and yet, also extremely believable.

And 2) it’s never about the conman being strange or not strange, proper or improper, waving red flags or not. It’s nice if red flags are there and one can spot them, but, sometimes people can’t, no matter how ‘good’ they are at spotting potential red flags. Some people are inexperienced, as I was then, and some are desperate not to see them.

This doesn’t make them stupid. This makes them vulnerable. There’s a difference.

The thing is, our ‘friendship’ (never sexual) got to a point where I allowed my mentally ill desperation and cognitive dissonance to be pushed so far that one night, there was a situation where Nathan basically told me the entire set up that was happening to me and all around me.

And I laughed.

It wasn’t that I laughed because, oh, look at me and how smart and manipulative I am to be using this guy. I was waaaaaay past that point, as I had said that months earlier to Kevin at the mall in some bizarre attempt to justify my friendship. I’m not sure I even believed that then, I simply felt the need to justify my friendship to another person for some reason.

I laughed because it was ‘genuinely’ funny, like he was telling a sick edgelord joke. It’s like, it was true, but it wasn’t true, and even if it was, it didn’t matter.

When you get to that point, because you were inexperienced and psychologically vulnerable to begin with (the latter being how people with mental health diagnoses are in general all the time), it’s not about him being strange, or you being stupid.

It’s just about abuse, and how eventually you end up attempting suicide, then changing your mind immediately, and then lying in a hospital bed for 36 hours in a coma.

The entire ordeal was a learning experience for me. Shortly after the 36 hour coma I kicked Nathan the fuck out of my life. He shut up, shut down, and realized that there was nothing he could do anymore. That’s when, still in a moment of manipulation, as that’s the only mode of communication for Ksaru, he said what I think was probably the most real and honest thing he’d ever said to me: “Asher… I have a problem.”

And I said, “I know.”

And that was that. It changed nothing. It just was. The pain, the disappointment, the hurt, and the realizations were all that was left and there wasn’t anything anyone could do about it anymore.

This is why I repeat the phrase, “guilt is a rope that wears thin.” I had recent friends that agreed with that phrase, I guess, and seemingly the spirit behind the woman who said it’s philosophy. Unfortunately, much like any other shallow furry just there for the vibes and “friendship,” they…

Actually, exactly like a furry just wanting to have friends and shoot the shit with ineffectually safe intellectualism, such as Derek, a space lion (I think?) otherwise known as Belanth, to whom I gave an undercovers handjob after becoming friends with me and announcing to me one day that he was now an Objectivist™.

One conversation with someone else later, being the smug CSU student Osiric (Belanth was working at a gas station) who tried to engage me in banter about how “surprised” he was I’d be into Maus (who I was with at that time) since Maus was such an “erudite,” and Belanth was already coming back with a big smile saying, “But, Asher, who owns the air?”

Despite the ultimate question being, of course, ‘who’s going to take care of the air?’, which is an okay question, I guess, this is a mistake I hear people make all the time. They take the idea of ownership and, without looking back, extend it far beyond any reasonable conception to create an axiom that doesn’t mean anything. You know, as you do when you aren’t actually thinking about what you’re thinking about.

Since individual rights exist (one of the political products of Objectivism’s moral realism) that means that they have a fundamental right to property. They own their life, and they can own other things (not lives). Take this as the baseline, however, as an axiom in and of itself like the old-school Libertarians used to do, ignoring any underlying philosophy, and you’ll be apt to conclude that everything in existence must then be owned.

Much like Rand objected, I object by pointing out that this is thinking “backward.” You’ve taken a conclusion from induction (remember, moral realism), and then turned it around to become something likely more familiar to someone like Belanth: knowledge, allegedly, from an idealist deduction.

The question, on the surface, is pointless. No one “owns” the air that floats around us on the planet. No one did anything to produce it, so, what claim could they have to its existence?

The concern that question usually gets extended to, hopefully, is one of, “How can we be sure, in ____ philosophy, that the air will remain useable for us to continue living?” or, put more simply, “What about the asshats that’ll pollute the environment and kill all of us?”

To me, this is a bit like claiming that Christianity (or any other religious duty-bound altruism) is a moral philosophy that prevents people from doing immoral things through punishment, self-discipline, and divine sanctions. And further, that this prevention makes it the only legitimate morality across the board.

But the truth is, altruism doesn’t prevent anyone from doing anything.

If someone wants to do something terrible, they just will. If you don’t believe me, well, then I have a better question for you: Why are confessionals necessary?

And, this isn’t like the claim itself (though my language betrays me), but rather the idea that, when constructing these sociomoral philosophies, we must put in safeguards (or guardrails, the latest popular term) of some kind to prevent things.

But, I ask, if they don’t actually prevent anything, then, why bother?

And this is an important point, as most all of my points are, not dismissive nihilism. You might ask, “What’s the problem with doing so? If it doesn’t do anything, at least it can point towards a better ought so people know what not to do.”

But, that’s exactly the problem.

The problem with constructing things that way, by preemptively placing guardrails along the path up the mountain is that, once they’re there, people don’t have much reason to think about them. And anyone who does is usually punished for questioning them, when, as I’ve pointed out, the guardrails never did anything in the first place.

It’s much more vicious when the guardrails themselves are shallow or axiomatic, offering little in way of explanation or reason. As you’ll be able to conclude later, this is an inevitability. In that case, not only is questioning discouraged, but no substantial thought or argument even exists. You put the guardrail down, and voila, no one makes the all-important argument as to why any particular person might not want to do something while also not being prevented from doing anything.

A moral vacuum, if you will, which is the point of guardrails.

The only way to truly create any sort of prevention is to make a solid, in-depth, clearly reasoned argument as to why one’s actions are the worst ones to take, and thus have a chance of creating the inner unassailable motivation within anyone to not do it.

If there isn’t really a reason for them to be motivated, most people won’t be. And if all your reasons have nothing to do with them and their interests at all, then most people aren’t going to actually care.

They just say sorry later.

But, I digress.

Once Belanth, teetering both in stature and intellect, decided that my entire philosophical argument (not Rand’s, mine) was smote with the question, “Who owns the air?”, being the exact same question my estranged brother asked one Christmas as he accused me of advocating a totalitarian regime because I refused to “allow” the ability to vote on other people’s rights, the friendship was over.

Much like the one I was talking about earlier.

When it becomes clear that the person talking to you no longer sees and understands you as you, but rather a version of themselves they’ve decided upon as you (since we’re all one giant consciousness, right?), then, what else is left to care about?

Also, just so we’re clear, I don’t “allow” anything.

During my time with Nathan Bruce Messer aka Avery Shepherd/Shephard aka Ksaru Foxfire aka AnarchyFur aka FoxyBoxers, one time owner of rentafox.com, PHP had just transitioned from PHP 4 to PHP 5. This was the beginning of true object-orientation in the language, something very much leveraged in practice today, and a step away from its (messy) procedural roots.

And I saw an opportunity. One day I thought, for some reason, “What if you could write code that was both compatible with previous versions and future versions without having to maintain separate files?”

In theory, this sounds like a great idea, since it reduces the number of codebase instances required, and in doing so reduces the number of errors due to non-synchronization to be introduced, the maintenance lag experienced due to deprioritizing, and the ability to have the previous version-specific code alongside current code so that the semantics of both (and their history) are immediately available

You can imagine it a bit like Knuth’s Literate Programming, where the codebase consists of files that intersperse code with other relevant material. You run the codebase through one compilation process and you get the documentation, and through the inverse compilation process to achieve the executable, or, leave it as is for the whole shebang.

But, seeing as how build processes aren’t really appreciated by most PHP developers (I think), especially at that time, I wasn’t only interested in securing a compiling filter. I wanted something that could be done in real time, and cached if desired, or compiled for security reasons, whichever.

When I program things, I lean more towards expressiveness without opinion because I assume the programmer, like me, knows exactly what they’re doing. My best practices and design philosophy may not be what would best fit their scenario, so, I feel no need to restrict anyone to them for their own good. I don’t know what’s in their best interest, so, fuck worrying myself, when programming, about people I don’t know and situations I’ll never know about.

And thus, the PHPIZER ‘package’ was born. It was bare and simple in set up. No version control, no framework, no package manager, just phpclasses.org (a place people put their PHP projects before mass adoption of package managers like Composer and Packagist). Unfortunately, today, I discovered I couldn’t reach the site. I don’t know if that’s permanent or temporary. However, I have come across the files in my vast 20+ TB archive, and so, I’ve put them here in code, and as a zip file, for you to download.

License

I release these now under the MIT License, though the original files say GNU GPL. The GPL is antithetical to what I desire my code to accomplish, so now, it is MIT. I have not included a new LICENSE file, so, you can just reference this paragraph with this anchor: #

Feedback

If you have any questions, comments, scolds, compliments, philosophical arguments, insults, or just want to say, “Hi!” then I’d truly appreciate it if you’d leave a comment below.

Yes, negative feedback is okay with me; however, this doesn’t mean you won’t receive the same.

When I state this, I know there are readers of my blog that will be interested in knowing what I believe the difference is between criticism and emotional injury, despite many of them ignoring it later. It’s this asymmetrical later that prompts me to write the following:

Criticism

There is a very dangerous line of thinking among wellness industry influencers, and thus the broader TikTok-fueled mental health discourse, that insists on emotional pain being an inevitable result of criticism. Or, to put it more naturally, they equate the presence of criticism as producing an inescapable reaction, unavoidable by human nature, consisting of emotional pain.

CRITICISM = PAIN

It’s a fact. That’s how people work.

Something’s wrong if you don’t feel pain after being criticized, and not in a good way. It could be an indicator that you have profound self-esteem problems and are unable to hold yourself as valuable.

And, that sounds okay in passing, like any thought-out TikTok, but it’s not.

On the surface, you’ll notice that a lot of the ‘content’ following such insistences is focused on how best to mitigate that inevitable pain so that you can appropriately abide appropriate criticism without either a) self-destructing, or b) destroying others.

But, of course, appropriate to who?

That inquiry quickly reveals a talking head that benefits from offering solutions to a problem they insist exists, whether it actually exists or not; one they may even be manufacturing. But, if it speaks to you at that moment, then, it’s helpful, so…

Right?

But, it isn’t.

This insistence does nothing but pin veils in front of every living theater stage where emotional pain resulting from interpersonal conflict plays out. For those who might’ve cared to look, well, now they can’t without someone pulling the curtain back for them; a sideshow interpreter to the allegedly horrifying scene: an ugly pain from things most likely irrelevant to criticism.

The audience does not ask if they are relevant or not, because, they are sure they know what is and isn’t criticism. But the bigger issue is that the curtain is often never pulled back, especially if the looked-towards interpreter makes up one side of the interpersonal conflict.

This obscurity probably sounds unintuitive, prone to new forms of gatekeeping, and straight out of a garish popular cartoon. However, the lack of intuitiveness is an advantageous feature of the ensuing show. And the show itself isn’t new, but as old as time. The only thing that’s really changed is democratization.

Fortunately unintuitive doesn’t mean complex.

It’s actually quite simple and clear: when people expect emotional pain to inevitably follow criticism, emotional pain becomes automatically re-frameable as a reaction to that criticism. And, conversely, abusive behaviors become automatically re-frameable as criticism.

If all criticism undeniably generates emotional pain, then, I ask, what’s the difference between criticism and actions intended to cause emotional injury?

If there is no difference in outcome, how does one effectively separate the two?

And if you can’t separate the two, even though they are separate socially and everyone just sorta knows it (because they are separate objectively)…

Then all anyone has to do to remain free of retribution is frame the expressed emotional injury as a reaction to the mundane and reasonable criticism that was layered in rather than anything else present.

If you’re unwilling to go that far, you can still observe the facts: by virtue of this insistence, introducing criticism to any dynamic immediately offers a mask for all underlying abuse. Any negative reactions will be socially redirected, automatically, to the least offensive elements of the exchange: the criticisms. This occurs because the offender, like anyone serving their interests, will rationally call for maximum benefit of the doubt at every turn.

Socially, to assert anything but the existence of the obvious criticism is to otherwise unfairly “read in,” and insert intents and motivations that require less doubt and more vulgar, limited assumptions. This, of course, only makes the situation unnecessarily worse.

But, unnecessary for what? And to whom?

This specific set-up takes this generalized form: an individual is subjected to emotional needling with criticism sprinkled in. Let’s say, after enough of this two-layered attack vector, the individual responds sarcastically to the whole affair, fed up, tired, and offended. After the encounter, the presumably socially responsible party, or in many cases, the one with the most to lose and the greatest ability to control information, can portray the nature of the exchange as ugly, horrible, and dysfunctional.

They’re not lying! The situation was everything they described. It’s simply a matter of who was doing what. All emotional injuries resulting from abuse (often interpresonal things indecipherable to outsiders) and all criticisms during the exchange are flattened into one equality. Criticism becomes emotional violence, and emotional violence becomes criticism.

And that’s because all criticism is emotional violence, in the end. Or so they say.

The portrayal of callousness, cruelty, and hurt by the vocal party is only relevant insofar as it’s pinned on someone that’s not them. It’s not truly relevant to the hoped for outcome; not under this insistence.

Once the other party realizes how it’s being received and going down, all further negative reactions from them become easily explainable by the interpreter who broke the story as emotional injuries to the dreaded criticism.

I’m pretty sure we’ve all heard variations of it before. The most popular one going around on social media at the time I abandoned it was, “They just can’t hear the truth about how they really are, so they’re taking it out on me and anyone else they feel is responsible for the misery they inflict on themselves.”

The veil is drawn, the curtain closes, and the situation is socially sealed.

If it’s not clear yet, I’m describing abuse.

Not only is this an abusive process, it self-perpetuates with few ever noticing, justifying itself in a highly engaging manner. It’s often presented in a way that seductively offers others the opportunity to show how much they care, how good of a person they are, and the nuances they’re able to apply to those less fortunate and balanced than them: those that can’t handle the dreaded criticism in a healthy way.

And so, the clicks justify themselves and the account grows, since people mostly do this online now.

If criticism and emotional pain are equivalent, inextricably stuck to each other like two sides of the same coin, this would be the objective result. But I know, and many others know, from experience and observation, that this isn’t the objective result. To many, there’s something off about the whole thing at one point or another, but, it’s hard to say what it is.

When I feel like something’s off, I like to find out exactly what it is. And in this case, the curtain I just described, that equalizing veil obscuring the differences between criticism and emotional injury, is what it is.

And I have grave objections to it.

Criticism is just telling someone they’re wrong, or you don’t like them, or that you have a different opinion, or that they’re bad somehow, an insult, a sneer, being rude, that they shouldn’t do something, or should do something. To a healthy person, criticism from random people is mostly noise, negative words that could be said by almost anyone at anytime, and aimed at anybody. If it resonates, you deal, and if it doesn’t, who cares?

I don’t object to that.

Phpizer Source Code

phpizer.class.phpPHP
<?php

/* Advanced Versioning Class
 * Written by Asher Holley ( http://www.wolfoxinc.com/opensource/ )
 * Released under the GNU General Public License ( http://www.opensource.org/licenses/gpl-license.html )
 * Copyright © 2006 Asher Holley
 *
 * This class is useful for determining what version of PHP you are running,
 *   as well as filtering included classes and function libraries so that the
 *   appropriate lines are executed for the appropriate PHP version.
 *
 * In order to make this class 'compatible' or in the least parseable without
 *   errors, 'vars' were avoided along with any constructor.  You can use
 *   this class without making an instance of it.	*/

require_once( 'phpizer.define.php' );
// require_once( 'filebase.class5.php' );

class Phpizer {

	function include_file( $filepath, $options = 0 ) {
		$chg = $b_matches = $l_matches = $matches = array();
		$above_1 = Phpizer::check_ver_1( '4.1.0' );	// efficiency
		
		if ( $options & V_FILEBASE ) {
			$filepath = Filebase::inc_path() . DIR_SEP . $filepath;
		}
		
		if ( $above_1 ) {
			if ( $options & V_INC_PATH ) {
				$code = file_get_contents( $filepath, 1 );
			} else {
				$code = file_get_contents( $filepath );
			}
			
			if ( !( $options & V_TRUNC_PHP ) ) {
				$code = substr( $code, 5, -2 );
			}
		} else {
			if ( $options & V_INC_PATH ) {
				$code = file( $filepath, 1 );
			} else {
				$code = file( $filepath );
			}
			
			if ( !( $options & V_NOT_TRUNC_PHP ) ) {
				$code[0] = substr( $code[0], 5 );
				$code[ count( $code ) - 1 ] =
					substr( $code[ count( $code ) - 1 ], 0, -2 );
				$code = join( '', $code );
			}
		}

		preg_match_all( VL_FIND_PHP, $code, $l_matches, PREG_SET_ORDER + PREG_OFFSET_CAPTURE );
		preg_match_all( VB_FIND_PHP, $code, $b_matches, PREG_SET_ORDER + PREG_OFFSET_CAPTURE );
		
		$matches = array_merge( $l_matches, $b_matches );
		foreach ( $matches as $match ) {
			for ( $a = 2; $a < 9; $a++ ) {
				if ( !isset( $match[$a] ) ) {
					$match[$a] = null;
				}
			}
			
			unset( $v1, $v2, $v1_1, $v1_2, $v1_3, $v2_1, $v2_2, $v2_3 );
			if ( $v1_1 = $match[2][0] ) {
				$v1 = $v1_1;
				if ( $v1_2 = $match[3][0] ) {
					$v1 .= ".$v1_2";
					if ( $v1_3 = $match[4][0] ) {
						$v1 = ".$v1_3";
					}
				}
			} else {
				trigger_error( 'Phpizer::include_file range without start',
							E_USER_ERROR );
			}
			
			if ( $r = $match[5][0] ) {
				if ( $match[6][0] ) {
					$v2 = $v2_1 = $match[6][0];
					if ( $v2_2 = $match[7][0] ? $match[7][0] : 0 ) {
						$v2 = ".$v2_2";
					}
					
					if ( $v2_3 = $match[8][0] ? $match[8][0] : 0 ) {
						$v2 = ".$v2_3";
					}
				}
			}
			
			$chg_set = false;
			if ( isset( $v1_2 ) ) {
				if ( isset( $v1_3 ) ) {
					if ( !$r ) {
						if ( $above_1 ) {
							if ( Phpizer::check_ver_2( 'eq', $v1 ) ) {
								$chg_set = true;
							}
						} else {
							if ( Phpizer::check_ver_1( $v1, true ) ) {
								$chg_set = true;
							}
						}
					} elseif ( isset( $v2 ) ) {
						if ( $above_1 ) {
							if ( Phpizer::check_ver_2( '>=', $v1 ) &&
									Phpizer::check_ver_2( '<', $v2 ) ) {
								$chg_set = true;
							}
						} else {
							if ( Phpizer::check_ver_1( $v1 ) &&
									( Phpizer::check_ver_1( $v2, true ) ||
										!Phpizer::check_ver_1( $v2 ) ) ) {
								$chg_set = true;
							}
						}
					} else {
						if ( $above_1 ) {
							if ( Phpizer::check_ver_2( '>=', $v1 ) ) {
								$chg_set = true;
							}
						} else {
							if ( Phpizer::check_ver_1( $v1 ) ) {
								$chg_set = true;
							}
						}
					}
				} else {
					if ( !$r ) {
						if ( $above_1 ) {
							if ( Phpizer::check_ver_2( '>=', $v1 . '.0' ) &&
									Phpizer::check_ver_2( '<',
										implode( '.', array( $v1_1, $v1_2 + 1, '0' ) ) ) ) {
								$chg_set = true;
							}
						} else {
							if ( Phpizer::check_ver_1( $v1 . '.0' ) &&
									!Phpizer::check_ver_1(
										implode( '.', array( $v1_1, $v1_2 + 1, '0' ) ) ) ) {
								$chg_set = true;
							}
						}
					} elseif ( isset( $v2 ) ) {
						if ( $above_1 ) {
							if ( Phpizer::check_ver_2( '>=', $v1 ) &&
									Phpizer::check_ver_2( '<', $v2 ) ) {
								$chg_set = true;
							}
						} else {
							if ( Phpizer::check_ver_1( $v1 ) &&
									( Phpizer::check_ver_1( $v2, true ) ||
										!Phpizer::check_ver_1( $v2 ) ) ) {
								$chg_set = true;
							}
						}
					} else {
						if ( $above_1 ) {
							if ( Phpizer::check_ver_2( '>=', $v1 . '.0' ) ) {
								$chg_set = true;
							}
						} else {
							if ( Phpizer::check_ver_1( $v1 . '.0' ) ) {
								$chg_set = true;
							}
						}
					}
				}
			} else {
				if ( !$r ) {
					if ( $above_1 ) {
						if ( Phpizer::check_ver_2( '>=', $v1 . '.0.0' ) &&
								Phpizer::check_ver_2( '<', $v1 + 1 . '.0.0' ) ) {
							$chg_set = true;
						}
					} else {
						if ( Phpizer::check_ver_1( $v1 . '.0.0' ) &&
								!Phpizer::check_ver_1( $v1 + 1 . '.0.0' ) ) {
							$chg_set = true;
						}
					}
				} elseif ( isset( $v2 ) ) {
					if ( $above_1 ) {
						if ( Phpizer::check_ver_2( '>=', $v1 ) &&
								Phpizer::check_ver_2( '<', $v2 ) ) {
							$chg_set = true;
						}
					} else {
						if ( Phpizer::check_ver_1( $v1 ) &&
								( Phpizer::check_ver_1( $v2, true ) ||
									!Phpizer::check_ver_1( $v2 ) ) ) {
							$chg_set = true;
						}
					}
				} else {
					if ( $above_1 ) {
						if ( Phpizer::check_ver_2( '>=', $v1 . '.0.0' ) ) {
							$chg_set = true;
						}
					} else {
						if ( Phpizer::check_ver_1( $v1 . '.0.0' ) ) {
							$chg_set = true;
						}
					}
				}
			}
			
			if ( $chg_set ) {
				$chg[] = array( 'loc' => $match[0][1],
								'len' => strlen( $match[0][0] ),
								'aft' => $match[1][0] );
			}
		}
		
		$adjust = 0;
		foreach ( $chg as $change ) {
			$l = strlen( $code );
			$code = substr_replace( $code, $change['aft'] . "\n",
									$change['loc'] - $adjust, $change['len'] );
			$adjust += $l - strlen( $code );
		}
		
		$code = preg_replace( array( VB_COMMENT, VL_COMMENT ), '', $code );
		$offlimits = Phpizer::get_outer_sections( $code );
		$v_matches = array();
		preg_match_all( '/\$[a-zA-Z_][a-zA-Z0-9_]*/', $code, $v_matches, PREG_OFFSET_CAPTURE );
		$adjust = 0;
		foreach( $v_matches[0] as $match ) {
			if ( $match[0] == '$GLOBALS' ) {
				break;
			}
			
			$outer = true;
			foreach ( $offlimits as $limit ) {
				if ( $match[1] >= $limit['s'] && $match[1] <= $limit['e'] ) {
					$outer = false;
					break;
				}
			}
			
			if ( $outer ) {
				$code = substr_replace( $code, '$GLOBALS[\'' . $match[0] . '\']',
							$match[1] + $adjust * 12, strlen( $match[0] ) );
				$adjust++;
			}
		}
		
		if ( !( $options & V_NOT_TRUNC_PHP ) ) {
			$ret = eval( $code );
			return array( $ret, $code );
		}
		
		return $code;
	}
	
	function get_outer_sections( $code ) {
		$l_matches = $r_matches = $c_matches = $f_matches = array();
		preg_match_all( '/class\s*\w+\s*(extends.*)?\s*\{/Uis',
					$code, $c_matches, PREG_OFFSET_CAPTURE );
		preg_match_all( '/function\s*\w+\s*\(.*\)\s*\{/Uis',
					$code, $f_matches, PREG_OFFSET_CAPTURE );
		preg_match_all( '/\{/', $code, $l_matches, PREG_OFFSET_CAPTURE );
		preg_match_all( '/\}/', $code, $r_matches, PREG_OFFSET_CAPTURE );
		preg_match_all( '/(?<!\\\\)([\'"]).*(?<!\\\\)\\1/Uis',
			$code, $q_matches, PREG_OFFSET_CAPTURE );
		for ( $a = 0; $a < count( $q_matches[0] ); $a++ ) {
			if ( strlen( $q_matches[0][$a][0] ) == 2 ) {
				unset( $q_matches[0][$a] );
			}
		}
		
		preg_match_all( '/\{/', $code, $l_matches, PREG_OFFSET_CAPTURE );
		preg_match_all( '/\}/', $code, $r_matches, PREG_OFFSET_CAPTURE );
		$mast = array_merge( $l_matches[0], $r_matches[0] );
		usort( $mast, array( 'Phpizer', 'cmp_tok' ) );
		foreach ( $q_matches[0] as $loc ) {
			for ( $a = 0; $a < count( $mast ); $a++ ) {
				if ( ( $end_char = $loc[1] + strlen( $loc[0] ) ) < $mast[$a][1] ) {
					break;
				}
				
				if ( !in_array( $a, $g ) ) {
					if ( $mast[$a][1] >= $loc[1] &&
							$mast[$a][1] <= $end_char ) {
						unset( $mast[$a] );
						$g[] = $a;
					}
				}
			}
			
			$c = array();
			if ( preg_match_all( '/\\\\\\$[a-zA-Z_][a-zA-Z0-9_]*/',
					$loc[0], $c, PREG_OFFSET_CAPTURE ) ) {
				foreach ( $c[0] as $m ) {
					$ret[] = array( 's' => $m[1] + $loc[1],
									'e' => ( $m[1] + $loc[1] ) + strlen( $m[0] ) );
				}
			}
		}
		
		$mast = array_merge( $c_matches[0], $f_matches[0], $mast );
		usort( $mast, array( 'Phpizer', 'cmp_tok' ) );
		reset( $mast );
		while ( ( $e_tok = each( $mast ) ) !== false ) {
			$tok = $e_tok[1];
			$s = array( 's' => 0, 'e' => 0 );
			$bcount = 0;
			if ( substr( $tok[0], 0, 5 ) == 'class' ) {
				$s['s'] = $tok[1];
				$e_tok = each( $mast );
				if ( $e_tok[1][0] != '{' ) {
					trigger_error( 'Phpizer::get_outer_sections class token not ' .
								'followed by bracket', E_USER_ERROR );
				} else {
					$bcount++;
				}
				
				while ( ( $e_tok = each( $mast ) ) !== false ) {
					$tok = $e_tok[1];
					if ( $tok[0] == '{' ) {
						$bcount++;
					} elseif ( $tok[0] == '}' ) {
						$bcount--;
					}
					
					if ( $bcount == 0 ) {
						$s['e'] = $tok[1];
						break;
					}
				}
			} elseif ( substr( $tok[0], 0, 8 ) == 'function' ) {
				$s['s'] = $tok[1];
				$e_tok = each( $mast );
				if ( $e_tok[1][0] != '{' ) {
					trigger_error( 'Phpizer::get_outer_sections class token not ' .
								'followed by bracket', E_USER_ERROR );
				} else {
					$bcount++;
				}
				
				while ( ( $e_tok = each( $mast ) ) !== false ) {
					$tok = $e_tok[1];
					if ( $tok[0] == '{' ) {
						$bcount++;
					} elseif ( $tok[0] == '}' ) {
						$bcount--;
					}
					
					if ( $bcount == 0 ) {
						$s['e'] = $tok[1];
						break;
					}
				}
			}
			
			$ret[] = $s;
		}
		
		return $ret;
	}
	
	// Sorting algorithm for outer sections code
	function cmp_tok( $a, $b ) {
		if ( $a[1] == $b[1] ) {
			return 0;
		}
		
		return ( $a[1] < $b[1] ) ? -1 : 1;
	}
	
	/* from php.net anonymous
	 * modified by Asher Holley
	 * if $req is '>=' PHP_VERSION returns true else return false
	 * if $opt is set returns true if $req == PHP_VERSION else false */
	function check_ver_1( $req, $opt = false ) {
		list( $c_major, $c_minor, $c_edit ) = split( '[/.-]', PHP_VERSION );
		list( $r_major, $r_minor, $r_edit ) = split( '[/.-]', $req );
	
		// Asher Holley modification
		if ( $opt ) {
			if ( $c_major == $r_major ) {
				if ( $c_minor == $r_minor ) {
					if ( $c_edit == $r_edit ) {
						return true;
					} else {
						return false;
					}
				} else {
					return false;
				}
			} else {
				return false;
			}
		}
		
		if ( $c_major > $r_major ) {
			return true;
		} else if ( $c_major < $r_major ) {
			return false;
		}
	
		// same major - check minor
		if ( $c_minor > $r_minor ) {
			return true;
		} else if ( $c_minor < $r_major ) {
			return false;
		}
	
		// same minor - check edit
		if ( $c_edit > $r_edit ) {
			return true;
		} else if ( $c_edit < $r_edit ) {
			return false;
		}
		
		// equal versions
		return true;
	}
	
	/* from mina86 at tlen dot pl
	 *   http://us3.php.net/manual/en/function.version-compare.php#43710	*/
	function check_ver_2( $arg1, $arg2 = null, $arg3 = null ) {
		static $phpversion = null;
		if ( $phpversion === null ) {
			$phpversion = phpversion();
		}
	
		switch ( func_num_args() ) {
			case 1:
				return version_compare( $phpversion, $arg1 );
				break;

			case 2:
				if ( preg_match('/^[lg][te]|[<>]=?|[!=]?=|eq|ne|<>$/i', $arg1 ) ) {
					return version_compare( $phpversion, $arg2, $arg1 );
				} elseif ( preg_match('/^[lg][te]|[<>]=?|[!=]?=|eq|ne|<>$/i', $arg2 ) ) {
					return version_compare( $phpversion, $arg1, $arg2 );
				}
			
				return version_compare( $arg1, $arg2 );
				break;

			default:
				$ver1 = $arg1;
				if ( preg_match('/^[lg][te]|[<>]=?|[!=]?=|eq|ne|<>$/i', $arg2 ) ) {
					return version_compare( $arg1, $arg3, $arg2 );
				} else {
					return version_compare( $arg1, $arg2, $arg3 );
				}
				
				break;
		}
	}
	
}

?>
phpizer.class5.phpPHP
<?php

/* Advanced Versioning Class
 * Written by Asher Holley ( http://www.wolfoxinc.com/opensource/ )
 * Released under the GNU General Public License ( http://www.opensource.org/licenses/gpl-license.html )
 * Copyright © 2006 Asher Holley
 *
 * This class is useful for determining what version of PHP you are running,
 *   as well as filtering included classes and function libraries so that the
 *   appropriate lines are executed for the appropriate PHP version.
 *
 * NOTE: THIS VERSION OF THE CLASS ASSUMES YOU ARE RUNNING PHP >= 5.0.0
 *
 * In order to make this class 'compatible' or in the least parseable without
 *   errors, 'vars' were avoided along with any constructor.  You can use
 *   this class without making an instance of it.	*/

require_once( 'phpizer.define.php' );
// require_once( 'filebase.class5.php' );

class Phpizer {

	public static function include_file( $filepath, $options = 0 ) {
		$chg = $b_matches = $l_matches = $matches = array();
		
		if ( $options & V_FILEBASE ) {
			$filepath = Filebase::inc_path() . DIR_SEP . $filepath;
		}
		
		if ( $options & V_INC_PATH ) {
			$code = file_get_contents( $filepath, 1 );
		} else {
			$code = file_get_contents( $filepath );
		}
		
		if ( !( $options & V_TRUNC_PHP ) ) {
			$code = substr( $code, 5, -2 );
		}

		preg_match_all( VL_FIND_PHP, $code, $l_matches, PREG_SET_ORDER + PREG_OFFSET_CAPTURE );
		preg_match_all( VB_FIND_PHP, $code, $b_matches, PREG_SET_ORDER + PREG_OFFSET_CAPTURE );
		
		$matches = array_merge( $l_matches, $b_matches );
		foreach ( $matches as $match ) {
			for ( $a = 2; $a < 9; $a++ ) {
				if ( !isset( $match[$a] ) ) {
					$match[$a] = null;
				}
			}
			
			unset( $v1, $v2, $v1_1, $v1_2, $v1_3, $v2_1, $v2_2, $v2_3 );
			if ( $v1_1 = $match[2][0] ) {
				$v1 = $v1_1;
				if ( $v1_2 = $match[3][0] ) {
					$v1 .= ".$v1_2";
					if ( $v1_3 = $match[4][0] ) {
						$v1 = ".$v1_3";
					}
				}
			} else {
				trigger_error( 'Phpizer::include_file range without start',
							E_USER_ERROR );
			}
			
			if ( $r = $match[5][0] ) {
				if ( $match[6][0] ) {
					$v2 = $v2_1 = $match[6][0];
					if ( $v2_2 = $match[7][0] ? $match[7][0] : 0 ) {
						$v2 = ".$v2_2";
					}
					
					if ( $v2_3 = $match[8][0] ? $match[8][0] : 0 ) {
						$v2 = ".$v2_3";
					}
				}
			}
			
			$chg_set = false;
			if ( isset( $v1_2 ) ) {
				if ( isset( $v1_3 ) ) {
					if ( !$r ) {
						if ( Phpizer::check_ver( 'eq', $v1 ) ) {
							$chg_set = true;
						}
					} elseif ( isset( $v2 ) ) {
						if ( Phpizer::check_ver( '>=', $v1 ) &&
								Phpizer::check_ver( '<', $v2 ) ) {
							$chg_set = true;
						}
					} else {
						if ( Phpizer::check_ver( '>=', $v1 ) ) {
							$chg_set = true;
						}
					}
				} else {
					if ( !$r ) {
						if ( Phpizer::check_ver( '>=', $v1 . '.0' ) &&
								Phpizer::check_ver( '<',
									implode( '.', array( $v1_1, $v1_2 + 1, '0' ) ) ) ) {
							$chg_set = true;
						}
					} elseif ( isset( $v2 ) ) {
						if ( Phpizer::check_ver( '>=', $v1 ) &&
								Phpizer::check_ver( '<', $v2 ) ) {
							$chg_set = true;
						}
					} else {
						if ( Phpizer::check_ver( '>=', $v1 . '.0' ) ) {
							$chg_set = true;
						}
					}
				}
			} else {
				if ( !$r ) {
					if ( Phpizer::check_ver( '>=', $v1 . '.0.0' ) &&
							Phpizer::check_ver( '<', $v1 + 1 . '.0.0' ) ) {
						$chg_set = true;
					}
				} elseif ( isset( $v2 ) ) {
					if ( Phpizer::check_ver( '>=', $v1 ) &&
							Phpizer::check_ver( '<', $v2 ) ) {
						$chg_set = true;
					}
				} else {
					if ( Phpizer::check_ver( '>=', $v1 . '.0.0' ) ) {
						$chg_set = true;
					}
				}
			}
			
			if ( $chg_set ) {
				$chg[] = array( 'loc' => $match[0][1],
								'len' => strlen( $match[0][0] ),
								'aft' => $match[1][0] );
			}
		}
		
		$adjust = 0;
		usort( $chg, array( 'Phpizer', 'cmp_rpl' ) );
		foreach ( $chg as $change ) {
			$l = strlen( $code );
			$code = substr_replace( $code, $change['aft'] . "\n",
									$change['loc'] - $adjust, $change['len'] );
			$adjust += $l - strlen( $code );
		}
		
		$code = preg_replace( array( VB_COMMENT, VL_COMMENT ), '', $code );
		$offlimits = Phpizer::get_outer_sections( $code );
		$v_matches = array();
		preg_match_all( '/\$[a-zA-Z_][a-zA-Z0-9_]*/', $code, $v_matches, PREG_OFFSET_CAPTURE );
		$adjust = 0;
		foreach( $v_matches[0] as $match ) {
			if ( $match[0] == '$GLOBALS' ) {
				break;
			}
			
			$outer = true;
			foreach ( $offlimits as $limit ) {
				if ( $match[1] >= $limit['s'] && $match[1] <= $limit['e'] ) {
					$outer = false;
					break;
				}
			}
			
			if ( $outer ) {
				$code = substr_replace( $code, '$GLOBALS[\'' . $match[0] . '\']',
							$match[1] + $adjust * 12, strlen( $match[0] ) );
				$adjust++;
			}
		}
		
		if ( !( $options & V_NOT_TRUNC_PHP ) ) {
			$ret = eval( $code );
			return array( $ret, $code );
		}
		
		return $code;
	}
	
	private static function get_outer_sections( $code ) {
		$l_matches = $r_matches = $c_matches = $f_matches = array();
		preg_match_all( '/class\s*\w+\s*(extends.*)?\s*\{/Uis',
					$code, $c_matches, PREG_OFFSET_CAPTURE );
		preg_match_all( '/function\s*\w+\s*\(.*\)\s*\{/Uis',
					$code, $f_matches, PREG_OFFSET_CAPTURE );
		preg_match_all( '/(?<!\\\\)([\'"]).*(?<!\\\\)\\1/Uis',
			$code, $q_matches, PREG_OFFSET_CAPTURE );
		for ( $a = 0; $a < count( $q_matches[0] ); $a++ ) {
			if ( strlen( $q_matches[0][$a][0] ) == 2 ) {
				unset( $q_matches[0][$a] );
			}
		}
		
		preg_match_all( '/\{/', $code, $l_matches, PREG_OFFSET_CAPTURE );
		preg_match_all( '/\}/', $code, $r_matches, PREG_OFFSET_CAPTURE );
		$mast = array_merge( $l_matches[0], $r_matches[0] );
		usort( $mast, array( 'Phpizer', 'cmp_tok' ) );
		foreach ( $q_matches[0] as $loc ) {
			for ( $a = 0; $a < count( $mast ); $a++ ) {
				if ( ( $end_char = $loc[1] + strlen( $loc[0] ) ) < $mast[$a][1] ) {
					break;
				}
				
				if ( !in_array( $a, $g ) ) {
					if ( $mast[$a][1] >= $loc[1] &&
							$mast[$a][1] <= $end_char ) {
						unset( $mast[$a] );
						$g[] = $a;
					}
				}
			}
			
			$c = array();
			if ( preg_match_all( '/\\\\\\$[a-zA-Z_][a-zA-Z0-9_]*/',
					$loc[0], $c, PREG_OFFSET_CAPTURE ) ) {
				foreach ( $c[0] as $m ) {
					$ret[] = array( 's' => $m[1] + $loc[1],
									'e' => ( $m[1] + $loc[1] ) + strlen( $m[0] ) );
				}
			}
		}
		
		$mast = array_merge( $c_matches[0], $f_matches[0], $mast );
		usort( $mast, array( 'Phpizer', 'cmp_tok' ) );
		reset( $mast );
		while ( ( $e_tok = each( $mast ) ) !== false ) {
			$tok = $e_tok[1];
			$s = array( 's' => 0, 'e' => 0 );
			$bcount = 0;
			if ( substr( $tok[0], 0, 5 ) == 'class' ) {
				$s['s'] = $tok[1];
				$e_tok = each( $mast );
				if ( $e_tok[1][0] != '{' ) {
					trigger_error( 'Phpizer::get_outer_sections class token not ' .
								'followed by bracket', E_USER_ERROR );
				} else {
					$bcount++;
				}
				
				while ( ( $e_tok = each( $mast ) ) !== false ) {
					$tok = $e_tok[1];
					if ( $tok[0] == '{' ) {
						$bcount++;
					} elseif ( $tok[0] == '}' ) {
						$bcount--;
					}
					
					if ( $bcount == 0 ) {
						$s['e'] = $tok[1];
						break;
					}
				}
			} elseif ( substr( $tok[0], 0, 8 ) == 'function' ) {
				$s['s'] = $tok[1];
				$e_tok = each( $mast );
				if ( $e_tok[1][0] != '{' ) {
					trigger_error( 'Phpizer::get_outer_sections class token not ' .
								'followed by bracket', E_USER_ERROR );
				} else {
					$bcount++;
				}
				
				while ( ( $e_tok = each( $mast ) ) !== false ) {
					$tok = $e_tok[1];
					if ( $tok[0] == '{' ) {
						$bcount++;
					} elseif ( $tok[0] == '}' ) {
						$bcount--;
					}
					
					if ( $bcount == 0 ) {
						$s['e'] = $tok[1];
						break;
					}
				}
			}
			
			$ret[] = $s;
		}
		
		return $ret;
	}
	
	// Sorting algorithm for outer sections code
	private static function cmp_tok( $a, $b ) {
		if ( $a[1] == $b[1] ) {
			return 0;
		}
		
		return ( $a[1] < $b[1] ) ? -1 : 1;
	}
	
	// Sorting for replacements
	private static function cmp_rpl( $a, $b ) {
		if ( $a['loc'] == $b['loc'] ) {
			return 0;
		}
		
		return ( $a['loc'] < $b['loc'] ) ? -1 : 1;
	}
	
	/* from mina86 at tlen dot pl
	 *   http://us3.php.net/manual/en/function.version-compare.php#43710	*/
	function check_ver( $arg1, $arg2 = null, $arg3 = null ) {
		static $phpversion = null;
		if ( $phpversion === null ) {
			$phpversion = phpversion();
		}
	
		switch ( func_num_args() ) {
			case 1:
				return version_compare( $phpversion, $arg1 );
				break;

			case 2:
				if ( preg_match('/^[lg][te]|[<>]=?|[!=]?=|eq|ne|<>$/i', $arg1 ) ) {
					return version_compare( $phpversion, $arg2, $arg1 );
				} elseif ( preg_match('/^[lg][te]|[<>]=?|[!=]?=|eq|ne|<>$/i', $arg2 ) ) {
					return version_compare( $phpversion, $arg1, $arg2 );
				}
			
				return version_compare( $arg1, $arg2 );
				break;

			default:
				$ver1 = $arg1;
				if ( preg_match('/^[lg][te]|[<>]=?|[!=]?=|eq|ne|<>$/i', $arg2 ) ) {
					return version_compare( $arg1, $arg3, $arg2 );
				} else {
					return version_compare( $arg1, $arg2, $arg3 );
				}
				
				break;
		}
	}
	
}

?>

I have no idea why I thought these weird extensions were okay given the fact that they’d either have to sit somewhere not accessible to a server, or the extensions would have to either be specially listed in a config most people don’t have access to, or in the inverse, configs would have to be super strict on extensions. Neither option is optimal for most use cases.

Turns out the Windows 10 machine I’m currently using, which is aberrant to my usual modus operandi, was not showing me the file extensions. A checkbox cured this insanity.

phpizer.define.phpPHP
<?php

/* Advanced Versioning Class
 * Written by Asher Holley ( http://www.wolfoxinc.com/opensource/ )
 * Released under the GNU General Public License ( http://www.opensource.org/licenses/gpl-license.html )
 * Copyright © 2006 Asher Holley
 *
 * Definitions file for phpizer.class.php */

/* SYNTAX FOR VERSIONING:
 *
 *     X-X-X makes the inclusion specific to that version only
 *     X-X makes the inclusion specific to X-X-0 -> X-X+1-0 ( latter not included )
 *     X makes the inclusion specific to X-0-0 -> X+1-0-0 (latter not included)
 *
 * If you want to make something for a particular version in general do this:
 *
 *     X-X-X > makes the inclusion from that specific version up
 *     X-X > makes the inclusion from X-X-0 and up
 *     X > makes the inclusion from X and up
 *
 *     X-X-X > Y-Y-Y makes the inclusion from x version to y version, y not included
 *     X-X > Y-Y ...
 *     X-X-X > Y ...
 *     X > Y-Y ...
 *     X > Y and so on. */

// The following definition identifies the 'tag' character denoting 

define( 'V_TOKEN', preg_quote( '%', '/' ) );
define( 'V_VERS_SPLIT', preg_quote( '-', '/' ) );
define( 'V_VERS_RANGE', preg_quote( '>', '/' ) );

// The following regular expressions identify the end-of-line 'tags'

define( 'VL_FIND_PHP', '/\\/\\/(.*)' . V_TOKEN . 'PHP(\d)?' .
		V_VERS_SPLIT . '?(\d)?' . V_VERS_SPLIT . '?(\d)?\s*(' .
		V_VERS_RANGE . ')?\s*(\d)?' . V_VERS_SPLIT . '?(\d)?' .
		V_VERS_SPLIT . '?(\d)?/' );

/* Example:
 *
 *   // $c = is_a( $a, 'Class' )	%PHP4 > 5
 *   // $c = $a instanceof Class	%PHP5-0-5
 *   // $c = $a instanceof Class    %PHP5 >
 */

// The following regular expressions identify the tags used for 'blocks'

define( 'VB_FIND_PHP', '/\\/\\*' . V_TOKEN . '(.*?)' . V_TOKEN .
		'PHP(\d)?' . V_VERS_SPLIT . '?(\d)?' . V_VERS_SPLIT .
		'?(\d)?\s*(' . V_VERS_RANGE . ')?\s*(\d)?' .
		V_VERS_SPLIT . '?(\d)?' . V_VERS_SPLIT .
		'?(\d)?.*?\s*\\*\\//s' );

/* Example:
 *
 *   /*% if ( is_a( $a, 'Class' ) ) {
 *			echo 'a is Class';
 *      }   %PHP4 > 5 */
/*
 *   /*% if ( $a instanceof 'Class' ) {
 *			echo 'a is Class';
 *      }   %PHP5 */
/* */

// These are the regular expressions used to eliminate all superfluous comments.

define( 'VL_COMMENT', '/\/\/.*/');
define( 'VB_COMMENT', '/\/\*.*\*\//Us' );

// These are the definitions used for the options to include_file

define( 'V_FILEBASE', 1 );
define( 'V_INC_PATH', 2 );

// The following will NOT truncate the php tags, NOR execute the file.
define( 'V_NOT_TRUNC_PHP', 4 );

?>
phpizer.proc.phpPHP
<?php

/* Advanced Versioning Procedures ( FOR PHP 3 )
 * Written by Asher Holley ( http://www.wolfoxinc.com/opensource/ )
 * Released under the GNU General Public License ( http://www.opensource.org/licenses/gpl-license.html )
 * Copyright © 2006 Asher Holley
 *
 * These procedures are useful for determining what version of PHP you are running,
 *   as well as filtering included classes and function libraries so that the
 *   appropriate lines are executed for the appropriate PHP version.  Due to
 *   the scope of eval inside of a method/function global variables must be
 *   assigned using either the keyword global (not recommended) or through
 *   $GLOBALS (recommended) within the filtered file.
 *
 * PLEASE NOTE!!! THESE PROCEDURES ASSUME YOU ARE RUNNING PHP >= 3.0.9.  FOR PHP 4+
 *   PLEASE INCLUDE/REQUIRE THE .class.php FILE INSTEAD!
 *
 * In order to make this class 'compatible' or in the least parseable without
 *   errors, 'vars' were avoided along with any constructor.  You can use
 *   This class without making an instance of it.	*/

require_once( 'phpizer.define.php' );
// require_once( 'filebase.class5.php' );

function include_file( $filepath, $options = 0 ) {
	if ( $options & V_FILEBASE ) {
		$filepath = Filebase::inc_path() . DIR_SEP . $filepath;
	}
	
	if ( $options & V_INC_PATH ) {
		$code = file( $filepath, 1 );
	} else {
		$code = file( $filepath );
	}
		
	if ( !( $options & V_TRUNC_PHP ) ) {
		$code[0] = substr( $code[0], 5 );
		$code[ count( $code ) - 1 ] =
			substr( $code[ count( $code ) - 1 ], 0, -2 );
		$code = join( '', $code );
	}
	
	preg_match_all( VL_FIND_PHP, $code, $l_matches, PREG_SET_ORDER + PREG_OFFSET_CAPTURE );
	preg_match_all( VB_FIND_PHP, $code, $b_matches, PREG_SET_ORDER + PREG_OFFSET_CAPTURE );
	
	$matches = array_merge( $l_matches, $b_matches );
	foreach ( $matches as $match ) {
		for ( $a = 2; $a < 9; $a++ ) {
			if ( !isset( $match[$a] ) ) {
				$match[$a] = null;
			}
		}
			
		unset( $v1, $v2, $v1_1, $v1_2, $v1_3, $v2_1, $v2_2, $v2_3 );
		if ( $v1_1 = $match[2][0] ) {
			$v1 = $v1_1;
			if ( $v1_2 = $match[3][0] ) {
				$v1 .= ".$v1_2";
				if ( $v1_3 = $match[4][0] ) {
					$v1 = ".$v1_3";
				}
			}
		} else {
			trigger_error( 'Phpizer::include_file range without start',
						E_USER_ERROR );
		}
		
		if ( $r = $match[5][0] ) {
			if ( $match[6][0] ) {
				$v2 = $v2_1 = $match[6][0];
				if ( $v2_2 = $match[7][0] ? $match[7][0] : 0 ) {
					$v2 = ".$v2_2";
				}
				
				if ( $v2_3 = $match[8][0] ? $match[8][0] : 0 ) {
					$v2 = ".$v2_3";
				}
			}
		}
			
		$chg_set = false;
		if ( isset( $v1_2 ) ) {
			if ( isset( $v1_3 ) ) {
				if ( !$r ) {
					if ( check_version( $v1, true ) ) {
						$chg_set = true;
					}
				} elseif ( isset( $v2 ) ) {
					if ( check_version( $v1 ) &&
							( check_version( $v2, true ) ||
								!check_version( $v2 ) ) ) {
						$chg_set = true;
					}
				} else {
					if ( check_version( $v1 ) ) {
						$chg_set = true;
					}
				}
			} else {
					if ( !$r ) {
						if ( check_version( $v1 . '.0' ) &&
								!check_version(
									implode( '.', array( $v1_1, $v1_2 + 1, '0' ) ) ) ) {
							$chg_set = true;
						}
					} elseif ( isset( $v2 ) ) {
						if ( check_version( $v1 ) &&
								( check_version( $v2, true ) ||
									!check_version( $v2 ) ) ) {
							$chg_set = true;
						}
					} else {
						if ( check_version( $v1 . '.0' ) ) {
							$chg_set = true;
						}
					}
				}
		} else {
			if ( !$r ) {
				if ( check_version( $v1 . '.0.0' ) &&
						!check_version( $v1 + 1 . '.0.0' ) ) {
					$chg_set = true;
				}
			} elseif ( isset( $v2 ) ) {
					if ( check_version( $v1 ) &&
							( check_version( $v2, true ) ||
								!check_version( $v2 ) ) ) {
						$chg_set = true;
					}
			} else {
				if ( check_version( $v1 . '.0.0' ) ) {
					$chg_set = true;
				}
			}
		}
		
		if ( $chg_set ) {
			$chg[] = array( 'loc' => $match[0][1],
							'len' => strlen( $match[0][0] ),
							'aft' => $match[1][0] );
		}
	}
	
	$adjust = 0;
	usort( $chg, 'cmp_rpl' );
	foreach ( $chg as $change ) {
		$l = strlen( $code );
		$code = substr( $code, 0, $change['loc'] - $adjust ) .
				$change['aft'] .
				substr( $code, $change['loc'] - $adjust + $change['len'] );
		$adjust += $l - strlen( $code );
	}
	
	$code = preg_replace( array( VB_COMMENT, VL_COMMENT ), '', $code );
	$offlimits = get_outer_sections( $code );
	$v_matches = array();
	preg_match_all( '/\$[a-zA-Z_][a-zA-Z0-9_]*/', $code, $v_matches, PREG_OFFSET_CAPTURE );
	$adjust = 0;
	foreach( $v_matches[0] as $match ) {
		if ( $match[0] == '$GLOBALS' ) {
			break;
		}
		
		$outer = true;
		foreach ( $offlimits as $limit ) {
			if ( $match[1] >= $limit['s'] && $match[1] <= $limit['e'] ) {
				$outer = false;
				break;
			}
		}
		
		if ( $outer ) {
			$code = substr_replace( $code, '$GLOBALS[\'' . $match[0] . '\']',
						$match[1] + $adjust * 12, strlen( $match[0] ) );
			$adjust++;
		}
	}
	
	if ( !( $options & V_NOT_TRUNC_PHP ) ) {
		$ret = eval( $code );
		return array( $ret, $code );
	}
		
	return $code;
}
	
function get_outer_sections( $code ) {
	$l_matches = $r_matches = $c_matches = $f_matches = array();
	preg_match_all( '/class\s*\w+\s*(extends.*)?\s*\{/Uis',
				$code, $c_matches, PREG_OFFSET_CAPTURE );
	preg_match_all( '/function\s*\w+\s*\(.*\)\s*\{/Uis',
				$code, $f_matches, PREG_OFFSET_CAPTURE );
	preg_match_all( '/(?<!\\\\)([\'"]).*(?<!\\\\)\\1/Uis',
		$code, $q_matches, PREG_OFFSET_CAPTURE );
	for ( $a = 0; $a < count( $q_matches[0] ); $a++ ) {
		if ( strlen( $q_matches[0][$a][0] ) == 2 ) {
			unset( $q_matches[0][$a] );
		}
	}
	
	preg_match_all( '/\{/', $code, $l_matches, PREG_OFFSET_CAPTURE );
	preg_match_all( '/\}/', $code, $r_matches, PREG_OFFSET_CAPTURE );
	$mast = array_merge( $l_matches[0], $r_matches[0] );
	foreach ( $q_matches[0] as $loc ) {
		for ( $a = 0; $a < count( $mast ); $a++ ) {
			if ( ( $end_char = $loc[1] + strlen( $loc[0] ) ) < $mast[$a][1] ) {
				break;
			}
			
			if ( !in_array( $a, $g ) ) {
				if ( $mast[$a][1] >= $loc[1] &&
						$mast[$a][1] <= $end_char ) {
					unset( $mast[$a] );
					$g[] = $a;
				}
			}
		}
		
		$c = array();
		if ( preg_match_all( '/\\\\\\$[a-zA-Z_][a-zA-Z0-9_]*/',
				$loc[0], $c, PREG_OFFSET_CAPTURE ) ) {
			foreach ( $c[0] as $m ) {
				$ret[] = array( 's' => $m[1] + $loc[1],
								'e' => ( $m[1] + $loc[1] ) + strlen( $m[0] ) );
			}
		}
	}
	
	$mast = array_merge( $c_matches[0], $f_matches[0], $mast );
	usort( $mast, array( 'Phpizer', 'cmp_tok' ) );
	reset( $mast );
	while ( ( $e_tok = each( $mast ) ) !== false ) {
		$tok = $e_tok[1];
		$s = array( 's' => 0, 'e' => 0 );
		$bcount = 0;
		if ( substr( $tok[0], 0, 5 ) == 'class' ) {
			$s['s'] = $tok[1];
			$e_tok = each( $mast );
			if ( $e_tok[1][0] != '{' ) {
				trigger_error( 'Phpizer::get_outer_sections class token not ' .
							'followed by bracket', E_USER_ERROR );
			} else {
				$bcount++;
			}
			
			while ( ( $e_tok = each( $mast ) ) !== false ) {
				$tok = $e_tok[1];
				if ( $tok[0] == '{' ) {
					$bcount++;
				} elseif ( $tok[0] == '}' ) {
					$bcount--;
				}
				
				if ( $bcount == 0 ) {
					$s['e'] = $tok[1];
					break;
				}
			}
		} elseif ( substr( $tok[0], 0, 8 ) == 'function' ) {
			$s['s'] = $tok[1];
			$e_tok = each( $mast );
			if ( $e_tok[1][0] != '{' ) {
				trigger_error( 'Phpizer::get_outer_sections class token not ' .
							'followed by bracket', E_USER_ERROR );
			} else {
				$bcount++;
			}
			
			while ( ( $e_tok = each( $mast ) ) !== false ) {
				$tok = $e_tok[1];
				if ( $tok[0] == '{' ) {
					$bcount++;
				} elseif ( $tok[0] == '}' ) {
					$bcount--;
				}
				
				if ( $bcount == 0 ) {
					$s['e'] = $tok[1];
					break;
				}
			}
		}
		
		$ret[] = $s;
	}
	
	return $ret;
}
	
// Sorting algorithm for outer sections code
function cmp_tok( $a, $b ) {
	if ( $a[1] == $b[1] ) {
		return 0;
	}
	
	return ( $a[1] < $b[1] ) ? -1 : 1;
}
	
// Sorting for replacements
function cmp_rpl( $a, $b ) {
	if ( $a['loc'] == $b['loc'] ) {
		return 0;
	}
	
	return ( $a['loc'] < $b['loc'] ) ? -1 : 1;
}

	
/* from php.net anonymous
 * modified by Asher Holley
 * if $req is '>=' PHP_VERSION returns true else return false */
function check_version( $req, $opt = false ) {
	list( $c_major, $c_minor, $c_edit ) = split( '[/.-]', PHP_VERSION );
	list( $r_major, $r_minor, $r_edit ) = split( '[/.-]', $req );

	// Asher Holley modification
	if ( $opt ) {
		if ( $c_major == $r_major ) {
			if ( $c_minor == $r_minor ) {
				if ( $c_edit == $r_edit ) {
					return true;
				} else {
					return false;
				}
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	
	if ( $c_major > $r_major ) {
		return true;
	} else if ( $c_major < $r_major ) {
		return false;
	}

	// same major - check minor
	if ( $c_minor > $r_minor ) {
		return true;
	} else if ( $c_minor < $r_major ) {
		return false;
	}

	// same minor - check edit
	if ( $c_edit > $r_edit ) {
		return true;
	} else if ( $c_edit < $r_edit ) {
		return false;
	}
	
	// equal versions
	return true;
}

?>
phpizer.test.phpPHP
<?php

/* Basic Versioning Test
 * Written by Asher Holley ( http://www.wolfoxinc.com/opensource/ )
 * Released under the GNU General Public License ( http://www.opensource.org/licenses/gpl-license.html )
 * Copyright © 2006 Asher Holley
 */

require_once( 'phpizer.class.php' );

Phpizer::include_file( 'vtest_include.class.php' );

echo( $gazebo . ' ' );
$temp = new Blubber( 'bouffant' );

// PHP4 should see: bulbous bouffant<br />\n
// PHP5 should see: bulbous bus!<br />\n

?>
phpizer.test2.phpPHP
<?php

/* Advanced Versioning Test
* Written by Asher Holley ( http://www.wolfoxinc.com/opensource/ )
* Released under the GNU General Public License ( http://www.opensource.org/licenses/gpl-license.html )
* Copyright © 2006 Asher Holley
*/

require_once( 'phpizer.class.php' );

// Check out this process if you have an IDE like Zend
Phpizer::include_file( 'stack.class.php' );

// To find my list.inter.php and list.abtr.php files look in my
// ps_stack class.

?>

“If you have an IDE like Zend” 😆

An Example: A Basic Stack Class

stack.class.phpPHP
<?php

/* Basic Stack Class
 * Written by Jon Lawrence ( http://www.phpclasses.org/browse/author/150618.html )
 * Modified by Asher Holley (http://www.wolfoxinc.com/opensource/)
 * Released under the GNU General Public License ( http://www.opensource.org/licenses/gpl-license.html )
 * Copyright © 2006 Asher Holley
 *
 * This stack conforms to almost all of the PostScript stack manipulators
 *      except for mark and cleartomark.  It is modified from its
 *      original design to eliminate the superfluous $index variable.
 *      It is designed for both PHP4 and PHP5 using Phpizer */

//	require_once( 'list.abstr.php' );	%PHP5 >

class Stack
// extends List_abstr implements ArrayAccess	%PHP5 >
// , Countable   %PHP5-1 >
{
	// var		%PHP4 > 5
	// private	%PHP5
	$lifo;

	function
	// __construct( $data = null )	%PHP5
	// Stack( $data = null )		%PHP4
	{
		if ( is_array( $data ) ) {
			$this->lifo = $data;
	//	} else if ( $data instanceof Stack ) {	%PHP5 >
	//	} else if ( is_a( $data, 'Stack' ) ) {	%PHP4 > 5
			$this->lifo = $data->lifo;
		} else if ( $data ) {
			$this->lifo = array();
			$this->lifo[] = $data;
		} else {
			$this->lifo = array();
		}

		return;
	}
	
	/*% public function offsetSet( $key, $value ) {
		if ( is_numeric( $key ) ) {
			if ( $this->index( $key ) ) {
				$r &= $this->index_ref( $key );
				$r = $value;
				return $value;
			}
		}
		
		if ( $key = '' ) {
			$this->push( $value );
		}
		
		return null;
	}
	
	public function offsetGet( $key ) {
		if ( is_numeric( $key ) ) {
			return $this->index( $key );
		}
		
		return null;
	}
	
	public function offsetUnset( $key ) {
		if ( is_numeric( $key ) ) {
			if ( $offset > ( $l = count( $this->lifo ) - 1 ) || $offset < 0 ) {
				return false;
			} else {
				unset( $this->lifo[ $l - $offset ] );
				return true;
			}
		}
		
		return false;
	}
	
	public function offsetExists( $offset ) {
		if ( is_numeric( $key ) ) {
			if ( $offset > ( $l = count( $this->lifo ) - 1 ) || $offset < 0 ) {
				return false;
			} else {
				return array_key_exists( $l - $offset, $this->lifo );
			}
		}
	}	%PHP5 >	*/
	
	// public	%PHP5 >
	function top() {
		if ( !empty( $this->lifo ) ) {
			return array_slice( $this->lifo, -1 );
		} else {
			return null;
		}
	}
	
	// public	%PHP5 >
	function &top_ref() {
		if ( !empty( $this->lifo ) ) {
			return $this->lifo[ $this->count() - 1 ];
		} else {
			return null;
		}
	}

	// public	%PHP5 >
	function push() {
		$args = func_get_args();
		$exec = 'array_push( $this->lifo';
		for ( $a = 0; $a < count( $args ); $a++ ) {
			$exec .= ', $args[' . $a . ']';
		}
		
		$exec .= ' );';
		return eval( $exec );
	}
	
	// public	%PHP5 >
	function push_ref( &$a ) {
		$this->lifo[] = $a;
		return;
	}

	// public	%PHP5 >
	function pop() {
		return array_pop( $this->lifo );
	}
	
	// public	%PHP5 >
	function &pop_ref() {
		$e =& $this->top_ref();
		array_pop( $this->lifo );
		return $e;
	}
	
	// public	%PHP5 >
	function index( $i ) {
		if ( $i > ( $l = count( $this->lifo ) - 1 ) || $i < 0 ) {
			return null;
		} else {
			return $this->lifo[ $l - $i ];
		}
	}
	
	// public	%PHP5 >
	function &index_ref( $i ) {
		if ( $i > ( $l = count( $this->lifo ) - 1 ) || $i < 0 ) {
			return null;
		} else {
			return $this->lifo[ $l - $i ];
		}
	}
	
	// public	%PHP5 >
	function count() {
		return count( $this->lifo );
	}
	
	// public	%PHP5 >
	function is_empty() {
		return empty( $this->lifo );
	}

	function clear() {
		$this->lifo = array();
		return;
	}

	// public	%PHP5 >
	function get_stack() {
		return array_reverse( $this->lifo );
	}
	
	// public	%PHP5 >
	function get_list() {
		return get_stack();
	}
	
	// public	%PHP5 >
	function exch() {
		$m1 =& $this->pop_ref();
		$m2 =& $this->pop_ref();
		$this->lifo[] =& $m1;
		$this->lifo[] =& $m2;
		return;
	}
	
	// public	%PHP5 >
	function dup() {
		$this->lifo[] = $this->top();
		return;
	}
	
	// public	%PHP5 >
	function roll( $c ) {
		if ( $c ) {
			if ( $c > ( $l = $this->count() ) ) {
				$c %= $l;
			}
			
			if ( $c > 0 ) { // rotate right
				$this->lifo = array_merge( array_slice( $this->lifo, $l - $c ),
										array_slice( $this->lifo, 0, $l - $c ) );
			} else if ( $c < 0 ) { // rotate left
				$c = abs( $c );
				$this->lifo = array_merge( array_slice( $this->lifo, $c ),
										array_slice( $this->lifo, 0, $c ) );
			}
		}

		return;
	}
}

?>

vtest_include.class.php… THESE FILENAMES!

vtest_include.class.phpPHP
<?php

/* Basic Versioning TEST FILE
 * Written by Asher Holley ( http://www.wolfoxinc.com/opensource/ )
 * Released under the GNU General Public License ( http://www.opensource.org/licenses/gpl-license.html )
 * Copyright © 2006 Asher Holley
 */

$GLOBALS['gazebo'] = 'bulbous';

/*% function galoshes( $spatula ) {
	echo( $spatula . "<br />\n" );
} %PHP4 */

class Blubber {
	// var $tuberculosis; %PHP4
	// private $tuberculosis; %PHP5
	
	// function __construct( $shindig ) { %PHP5
	// function Blubber( $shindig ) { %PHP4
		$this->tuberculosis = $shindig;
		// echo( "bus!<br />\n" ); %PHP5
		// galoshes( $this->tuberculosis ); %PHP4
	}
}

?>

Download

And the compressed files:

In Practice

In practice, this sorta works. But, it’s so outside the flow of what programmers are generally going to work with, it’s not particularly useful except in small doses. This comments out whole sections of code. It makes error reports opaque (which, I never got around to fixing), and runs on eval() which is, uh, okay, but scary. Better to actually compile and cache really, and that’s the thing: if the tooling surrounding this strangeness isn’t able to fit to it to ease development, it’s dead in the water.

On top of that, another question becomes, is it even worth it or necessary? I think, in some cases, depending on your goals, it can be. Like, if one of your goals is backward compatibility (at least in code generation) forever, then, it’s worth it. If not, though, and it probably isn’t, then, why hold on to bloated code for things you’re never going to target again?

Leave a Reply

Your email address will not be published. Required fields are marked *